ste: Add support for multiple pdp contexts.
PATCH v2 1/2 ste: Add support for multiple pdp contexts.
From: Marit Henriksen <[email protected]>
--- plugins/ste.c | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-)
plugins/ste.c +12 -5
@@ -66,6 +66,7 @@#include <drivers/stemodem/if_caif.h> #define NUM_CHAT 1 +#define MAX_PDP_CONTEXTS 4static const char *cpin_prefix[] = {"+CPIN:" ,NULL };
@@ -363,6 +364,7 @@ static void ste_post_online(struct ofono_modem *modem)struct ofono_message_waiting *mw;struct ofono_gprs *gprs;struct ofono_gprs_context *gc; +int i;DBG ("%p" , modem);
@@ -378,13 +380,18 @@ static void ste_post_online(struct ofono_modem *modem) gprs =ofono_gprs_create (modem,OFONO_VENDOR_MBM ,"atmodem" , data->chat); - gc =ofono_gprs_context_create (modem,0 ,"stemodem" , data->chat); - -if (gprs && gc) -ofono_gprs_add_context (gprs, gc); +if (gprs) { +for (i =0 ; i <MAX_PDP_CONTEXTS ; i++) { + gc =ofono_gprs_context_create ( + modem,0 ,"stemodem" , data->chat); +if (gc ==NULL ) +break ; + +ofono_gprs_add_context (gprs, gc); + } + } mw =ofono_message_waiting_create (modem); -if (mw)ofono_message_waiting_register (mw); }
Signature · 1 line
1.7.1
Hi Marit,
Quoted 2 lines
plugins/ste.c | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-)
patch has been applied.
Regards
Marcel