laforge has submitted this change. ( https://gerrit.osmocom.org/c/onomondo-ipa/+/43060?usp=email )
(
8 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: V1.2: Add function to set Device Capabilities ......................................................................
V1.2: Add function to set Device Capabilities
Add new library function to set the SGP.22 Device Capabilities. Also add an option to the command line interface to call the library function.
The IoT device (modem) may and the IPA must set Device Capabilities. They cannot be set independently. The IoT device would overwrite what IPA has set and vice versa. Therefore add a library function for the IoT device that takes care about setting the required capabilities for IPA.
Reference: SGP.22 Section 3.4.2
Related: SYS#8101 Change-Id: I866787b8cda9a87a9f2e0db4965fbb554d339a6c --- M include/onomondo/ipa/ipad.h M src/ipa/libipa/euicc.c M src/ipa/main.c 3 files changed, 15 insertions(+), 2 deletions(-)
Approvals: dexter: Looks good to me, approved Jenkins Builder: Verified
diff --git a/include/onomondo/ipa/ipad.h b/include/onomondo/ipa/ipad.h index 42086fa..8bea1d8 100644 --- a/include/onomondo/ipa/ipad.h +++ b/include/onomondo/ipa/ipad.h @@ -86,6 +86,12 @@ * function here to handle the consent request. In case no callback function is provided onomondo-eim will * automatically consent to any profile installation. */ ipa_prfle_inst_consent_cb prfle_inst_consent_cb; + + /*! Set the Device Capabilities. + * As IPAd need to set the device capabilities, it overwrites any other capabilities that might have set by + * the modem or IoT device. The upper 5 bits can be set according to section 3.4.2 of SGG.22. The lower 3 + * bit are set automatically by this IPAd. */ + uint8_t device_capabilities; };
struct ipa_context *ipa_new_ctx(struct ipa_config *cfg, struct ipa_buf *nvstate); diff --git a/src/ipa/libipa/euicc.c b/src/ipa/libipa/euicc.c index cfeda30..e6cc5fc 100644 --- a/src/ipa/libipa/euicc.c +++ b/src/ipa/libipa/euicc.c @@ -532,12 +532,14 @@ * \returns 0 on success, negative on error. */ int ipa_euicc_init_es10x(struct ipa_context *ctx) { - /* Capabilities according to 3GPP TS 102.221, section 11.1.19.2.4 and GSMA SGP.32, section 3.8.2 */ + /* Capabilities according to 3GPP TS 102.221, section 11.1.19.2.4 and + * GSMA SGP.22, section 3.4.2 and GSMA SGP.32, section 3.8.2 */ uint8_t termcap[] = { 0xA9, 0x06, 0x83, 0x01, 0x07, 0x84, 0x01, 0x01 }; size_t termcap_size = sizeof(termcap); int rc;
/* Set capabilities to enable support for eUICC and IoT functions. */ + termcap[4] |= ctx->cfg->device_capabilities; /* A non-IoT eUICC does not have IoT capabilities. */ if (ctx->cfg->iot_euicc_emu_enabled) { termcap[1] -= 3; diff --git a/src/ipa/main.c b/src/ipa/main.c index 4a61762..9ad3fbc 100644 --- a/src/ipa/main.c +++ b/src/ipa/main.c @@ -69,6 +69,7 @@ printf(" -I .......................... disable SSL certificate verification (insecure)\n"); printf(" -E .......................... emulate IoT eUICC (compatibility mode to use consumer eUICCs)\n"); printf(" -1 .......................... force the IPAd to process only one eUICC package (debug, use with caution)\n"); + printf(" -D 0xXX ..................... set optional device capabilities (SGP.22, table 7, bits 8..4)\n"); printf("operation:\n"); printf(" get-eim-package ............. Ask eIM for eIM package and process it (default operation)\n"); printf(" add-initial-eim PATH ........ set initial eIM configuration from given file\n"); @@ -179,7 +180,7 @@
/* Overwrite configuration values with user defined parameters */ while (1) { - opt = getopt(argc, argv, "ht:e:r:c:Rn:C:SIEy:a1"); + opt = getopt(argc, argv, "ht:e:r:c:Rn:C:SIEy:a1D:"); if (opt == -1) break;
@@ -227,6 +228,9 @@ case '1': getopt_one_euicc_pkg_only = true; break; + case 'D': + cfg.device_capabilities = strtoul(optarg, NULL, 0); + break; default: printf("unsupported option: %c!\n", opt); opt = -1; @@ -281,6 +285,7 @@ printf(" tac = %s\n", ipa_hexdump(cfg.tac, sizeof(cfg.tac))); printf(" iot_euicc_emu_enabled = %u\n", cfg.iot_euicc_emu_enabled); printf(" esipa_req_retries = %u\n", cfg.esipa_req_retries); + printf(" device_capabilities = 0x%02x\n", cfg.device_capabilities); printf("\n");
if (cfg.eim_cabundle) {