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.
This commit is contained in:
Dan Williams
2010-09-21 14:56:47 -05:00
parent 674a9412fe
commit 49097b6de5

View File

@@ -10,7 +10,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details:
*
* Copyright (C) 2008 - 2009 Dan Williams <dcbw@redhat.com>
* Copyright (C) 2008 - 2010 Dan Williams <dcbw@redhat.com>
*/
#include <string.h>
@@ -136,16 +136,16 @@ grab_port (MMPluginBase *base,
caps = mm_plugin_base_supports_task_get_probed_capabilities (task);
sysfs_path = mm_plugin_base_supports_task_get_physdev_path (task);
if (!existing) {
if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) {
modem = mm_generic_gsm_new (sysfs_path,
mm_plugin_base_supports_task_get_driver (task),
mm_plugin_get_name (MM_PLUGIN (base)));
} else if (caps & CAP_CDMA) {
if (caps & CAP_CDMA) {
modem = mm_generic_cdma_new (sysfs_path,
mm_plugin_base_supports_task_get_driver (task),
mm_plugin_get_name (MM_PLUGIN (base)),
!!(caps & MM_PLUGIN_BASE_PORT_CAP_IS856),
!!(caps & MM_PLUGIN_BASE_PORT_CAP_IS856_A));
} else if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) {
modem = mm_generic_gsm_new (sysfs_path,
mm_plugin_base_supports_task_get_driver (task),
mm_plugin_get_name (MM_PLUGIN (base)));
}
if (modem) {