Re: connect using a specific PDP CID

2019-03-08 Thread Aleksander Morgado
On Fri, Mar 8, 2019 at 7:47 PM matthew stanger  wrote:
>>
>> I’m trying to use ModemManager 1.8.2 with a Verizon LTE Cat-M1 modem.
>
> Aleksander wrote this for my team for this very case. I've re-based it to 
> 1.8.2 so it should go on clean.
>
>> We should work on the new API at some point...
>
> I really think the patch here is great to be honest. Again we are using it 
> not just for Vzw but also in Asia where a few carrier's require PDP #1.
>

I have mixed feelings about this patch :) in one side, it's not the
best way to do it, as a proper profile management API would be best,
but from the other side it's a quick way to get the issue resolved
until that API is developed; if ever!
@Dan Williams what do you think? should we think in integrating this
workaround until the profile management API is done?

>
>
> From da8bc6feb036cfdcd5db8280f00565c82685d794 Mon Sep 17 00:00:00 2001
> From: Aleksander Morgado 
> Date: Fri, 12 May 2017 18:24:13 +0200
> Subject: [PATCH 1/1] allow specifying the PDP CID to use
>
> Some operators, most notably Verizon, require connection to be
> performed through a specific PDP context. This API update allows the
> user to specify the PDP cid via a new 'pdp-cid' parameter given in
> either the Simple.Connect() or the Modem.CreateBearer() methods.
>
> Signed-off-by: mstanger 
> ---
>  cli/mmcli-bearer.c |  9 
>  docs/reference/libmm-glib/libmm-glib-sections.txt  |  4 ++
>  .../org.freedesktop.ModemManager1.Modem.xml|  2 +
>  libmm-glib/mm-bearer-properties.c  | 59 
> +-
>  libmm-glib/mm-bearer-properties.h  |  3 ++
>  libmm-glib/mm-simple-connect-properties.c  | 34 +
>  libmm-glib/mm-simple-connect-properties.h  |  3 ++
>  src/mm-broadband-bearer.c  | 41 ++-
>  src/mm-iface-modem-simple.c| 13 +++--
>  9 files changed, 150 insertions(+), 18 deletions(-)
>
> diff --git a/cli/mmcli-bearer.c b/cli/mmcli-bearer.c
> index cd9ecca..daa8614 100644
> --- a/cli/mmcli-bearer.c
> +++ b/cli/mmcli-bearer.c
> @@ -163,11 +163,18 @@ print_bearer_info (MMBearer *bearer)
>
>  if (properties) {
>  gchar *ip_family_str;
> +gchar *pdp_cid_str = NULL;
> +guint  pdp_cid;
>
>  ip_family_str = (mm_bearer_ip_family_build_string_from_mask (
>   mm_bearer_properties_get_ip_type (properties)));
> +
> +if ((pdp_cid = mm_bearer_properties_get_pdp_cid (properties)) != 0)
> +pdp_cid_str = g_strdup_printf ("%u", pdp_cid);
> +
>  g_print ("  -\n"
>   "  Properties | apn: '%s'\n"
> + " | PDP CID: '%s'\n"
>   " | roaming: '%s'\n"
>   " | IP type: '%s'\n"
>   " |user: '%s'\n"
> @@ -175,6 +182,7 @@ print_bearer_info (MMBearer *bearer)
>   " |  number: '%s'\n"
>   " | Rm protocol: '%s'\n",
>   VALIDATE_NONE (mm_bearer_properties_get_apn (properties)),
> + VALIDATE_NONE (pdp_cid_str),
>   mm_bearer_properties_get_allow_roaming (properties) ? 
> "allowed" : "forbidden",
>   VALIDATE_UNKNOWN (ip_family_str),
>   VALIDATE_NONE (mm_bearer_properties_get_user (properties)),
> @@ -183,6 +191,7 @@ print_bearer_info (MMBearer *bearer)
>   VALIDATE_UNKNOWN (mm_modem_cdma_rm_protocol_get_string (
> mm_bearer_properties_get_rm_protocol 
> (properties;
>  g_free (ip_family_str);
> +g_free (pdp_cid_str);
>  }
>
>  /* IPv4 */
> diff --git a/docs/reference/libmm-glib/libmm-glib-sections.txt 
> b/docs/reference/libmm-glib/libmm-glib-sections.txt
> index 46f2d92..077e7ee 100644
> --- a/docs/reference/libmm-glib/libmm-glib-sections.txt
> +++ b/docs/reference/libmm-glib/libmm-glib-sections.txt
> @@ -779,6 +779,8 @@ mm_simple_connect_properties_get_operator_id
>  mm_simple_connect_properties_set_operator_id
>  mm_simple_connect_properties_get_apn
>  mm_simple_connect_properties_set_apn
> +mm_simple_connect_properties_get_pdp_cid
> +mm_simple_connect_properties_set_pdp_cid
>  mm_simple_connect_properties_get_allowed_auth
>  mm_simple_connect_properties_set_allowed_auth
>  mm_simple_connect_properties_get_user
> @@ -1064,6 +1066,8 @@ mm_bearer_properties_new
>  
>  mm_bearer_properties_get_apn
>  mm_bearer_properties_set_apn
> +mm_bearer_properties_get_pdp_cid
> +mm_bearer_properties_set_pdp_cid
>  mm_bearer_properties_get_allowed_auth
>  mm_bearer_properties_set_allowed_auth
>  mm_bearer_properties_get_user
> diff --git a/introspection/org.freedesktop.ModemManager1.Modem.xml 
> 

Re: connect using a specific PDP CID

2019-03-08 Thread matthew stanger
>
> I’m trying to use ModemManager 1.8.2 with a Verizon LTE Cat-M1 modem.

Aleksander wrote this for my team for this very case. I've re-based it to
1.8.2 so it should go on clean.

We should work on the new API at some point...

I really think the patch here is great to be honest. Again we are using it
not just for Vzw but also in Asia where a few carrier's require PDP #1.



>From da8bc6feb036cfdcd5db8280f00565c82685d794 Mon Sep 17 00:00:00 2001
From: Aleksander Morgado 
Date: Fri, 12 May 2017 18:24:13 +0200
Subject: [PATCH 1/1] allow specifying the PDP CID to use

Some operators, most notably Verizon, require connection to be
performed through a specific PDP context. This API update allows the
user to specify the PDP cid via a new 'pdp-cid' parameter given in
either the Simple.Connect() or the Modem.CreateBearer() methods.

Signed-off-by: mstanger 
---
 cli/mmcli-bearer.c |  9 
 docs/reference/libmm-glib/libmm-glib-sections.txt  |  4 ++
 .../org.freedesktop.ModemManager1.Modem.xml|  2 +
 libmm-glib/mm-bearer-properties.c  | 59
+-
 libmm-glib/mm-bearer-properties.h  |  3 ++
 libmm-glib/mm-simple-connect-properties.c  | 34 +
 libmm-glib/mm-simple-connect-properties.h  |  3 ++
 src/mm-broadband-bearer.c  | 41 ++-
 src/mm-iface-modem-simple.c| 13 +++--
 9 files changed, 150 insertions(+), 18 deletions(-)

diff --git a/cli/mmcli-bearer.c b/cli/mmcli-bearer.c
index cd9ecca..daa8614 100644
--- a/cli/mmcli-bearer.c
+++ b/cli/mmcli-bearer.c
@@ -163,11 +163,18 @@ print_bearer_info (MMBearer *bearer)

 if (properties) {
 gchar *ip_family_str;
+gchar *pdp_cid_str = NULL;
+guint  pdp_cid;

 ip_family_str = (mm_bearer_ip_family_build_string_from_mask (
  mm_bearer_properties_get_ip_type
(properties)));
+
+if ((pdp_cid = mm_bearer_properties_get_pdp_cid (properties)) != 0)
+pdp_cid_str = g_strdup_printf ("%u", pdp_cid);
+
 g_print ("  -\n"
  "  Properties | apn: '%s'\n"
+ " | PDP CID: '%s'\n"
  " | roaming: '%s'\n"
  " | IP type: '%s'\n"
  " |user: '%s'\n"
@@ -175,6 +182,7 @@ print_bearer_info (MMBearer *bearer)
  " |  number: '%s'\n"
  " | Rm protocol: '%s'\n",
  VALIDATE_NONE (mm_bearer_properties_get_apn (properties)),
+ VALIDATE_NONE (pdp_cid_str),
  mm_bearer_properties_get_allow_roaming (properties) ?
"allowed" : "forbidden",
  VALIDATE_UNKNOWN (ip_family_str),
  VALIDATE_NONE (mm_bearer_properties_get_user
(properties)),
@@ -183,6 +191,7 @@ print_bearer_info (MMBearer *bearer)
  VALIDATE_UNKNOWN (mm_modem_cdma_rm_protocol_get_string (

mm_bearer_properties_get_rm_protocol (properties;
 g_free (ip_family_str);
+g_free (pdp_cid_str);
 }

 /* IPv4 */
diff --git a/docs/reference/libmm-glib/libmm-glib-sections.txt
b/docs/reference/libmm-glib/libmm-glib-sections.txt
index 46f2d92..077e7ee 100644
--- a/docs/reference/libmm-glib/libmm-glib-sections.txt
+++ b/docs/reference/libmm-glib/libmm-glib-sections.txt
@@ -779,6 +779,8 @@ mm_simple_connect_properties_get_operator_id
 mm_simple_connect_properties_set_operator_id
 mm_simple_connect_properties_get_apn
 mm_simple_connect_properties_set_apn
+mm_simple_connect_properties_get_pdp_cid
+mm_simple_connect_properties_set_pdp_cid
 mm_simple_connect_properties_get_allowed_auth
 mm_simple_connect_properties_set_allowed_auth
 mm_simple_connect_properties_get_user
@@ -1064,6 +1066,8 @@ mm_bearer_properties_new
 
 mm_bearer_properties_get_apn
 mm_bearer_properties_set_apn
+mm_bearer_properties_get_pdp_cid
+mm_bearer_properties_set_pdp_cid
 mm_bearer_properties_get_allowed_auth
 mm_bearer_properties_set_allowed_auth
 mm_bearer_properties_get_user
diff --git a/introspection/org.freedesktop.ModemManager1.Modem.xml
b/introspection/org.freedesktop.ModemManager1.Modem.xml
index a5a236c..23c14ed 100644
--- a/introspection/org.freedesktop.ModemManager1.Modem.xml
+++ b/introspection/org.freedesktop.ModemManager1.Modem.xml
@@ -61,6 +61,8 @@
 
 "apn"
   Access Point Name, given as a string value
(signature "s"). Required in
3GPP.
+"pdp-cid"
+  PDP context identifier, given as an unsigned
32-bit integer value (signature "u"). Optional in
3GPP.
 "ip-type"
   Addressing type, given as a MMBearerIpFamily value (signature
"u"). Optional in 3GPP and
CDMA.
 "allowed-auth"
diff --git a/libmm-glib/mm-bearer-properties.c

Re: connect using a specific PDP CID

2019-03-08 Thread Aleksander Morgado
> I’m trying to use ModemManager 1.8.2 with a Verizon LTE Cat-M1 modem. Verizon 
> requires using PDP context #3 for the internet connection. I read the thread 
> from 2017 
> (https://lists.freedesktop.org/archives/modemmanager-devel/2017-May/004663.html)
>  in which a patch was proposed to handle this case in ModemManager, but saw 
> that the thread ended with a plan to develop a new API for managing profiles 
> instead of that patch.
>
>
>
> But I haven’t been able to find this new API, and it doesn’t look like the 
> original patch was applied either. Is this profile management API available 
> in 1.8.2, or in a newer version? How do I force ModemManager to use PDP 
> context #3 for the internet connection?
>

Right now, you could manually create the PDP context with the settings
you want, and MM should re-use the already created context if the
settings requested match the existing ones.

We should work on the new API at some point...

-- 
Aleksander
https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel

connect using a specific PDP CID

2019-03-08 Thread Taff, Philip
I'm trying to use ModemManager 1.8.2 with a Verizon LTE Cat-M1 modem. Verizon 
requires using PDP context #3 for the internet connection. I read the thread 
from 2017 
(https://lists.freedesktop.org/archives/modemmanager-devel/2017-May/004663.html)
 in which a patch was proposed to handle this case in ModemManager, but saw 
that the thread ended with a plan to develop a new API for managing profiles 
instead of that patch.

But I haven't been able to find this new API, and it doesn't look like the 
original patch was applied either. Is this profile management API available in 
1.8.2, or in a newer version? How do I force ModemManager to use PDP context #3 
for the internet connection?

-Philip

___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel

Re: Planning to add a PCIe(not in USB protocol) device

2019-03-08 Thread Daniele Palmas
Hi Bjørn,

Il giorno lun 10 dic 2018 alle ore 14:25 Bjørn Mork  ha scritto:
>
> As for Qualcomm based modems:  Haven't yet seen any docs for the PCIe
> interface there either.  So I'll assume it is similar to the Intel one.

related to Qualcomm I guess this development

http://archive.lwn.net:8080/linux-kernel/1524795811-21399-1-git-send-email-sd...@codeaurora.org/

should be related, but unfortunately it seems that the attempt for
upstream inclusion stopped.

Regards,
Daniele
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel