From 4ec250b24fb44ed345f2176f57a69a7bc3c79a8c Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Mon, 4 Mar 2019 17:39:38 +0100 Subject: [PATCH] pkg/nimble: bump version to a7b3c93 - version update to a7b3c93 - remove patches (merged to changes to nimble upstream) - adapt initialization order to upstream changes --- pkg/nimble/Makefile | 2 +- pkg/nimble/contrib/nimble_riot.c | 20 ++--- ...do-not-discard-alignment-information.patch | 86 ------------------- 3 files changed, 10 insertions(+), 98 deletions(-) delete mode 100644 pkg/nimble/patches/0001-L2CAP-sm-do-not-discard-alignment-information.patch diff --git a/pkg/nimble/Makefile b/pkg/nimble/Makefile index e71088245d95..8431345abc44 100644 --- a/pkg/nimble/Makefile +++ b/pkg/nimble/Makefile @@ -1,6 +1,6 @@ PKG_NAME = nimble PKG_URL = https://github.com/apache/mynewt-nimble.git -PKG_VERSION = ef58876024218e488dcbc15c8631db016241ab1f +PKG_VERSION = a7b3c939146e735b59d55bff740c906bde6f86f9 PKG_LICENSE = Apache-2.0 TDIR = $(RIOTPKG)/$(PKG_NAME) diff --git a/pkg/nimble/contrib/nimble_riot.c b/pkg/nimble/contrib/nimble_riot.c index 297b3b8e168f..20fe26c752d3 100644 --- a/pkg/nimble/contrib/nimble_riot.c +++ b/pkg/nimble/contrib/nimble_riot.c @@ -46,21 +46,12 @@ static void *_host_thread(void *arg) (void)arg; nimble_port_init(); - nimble_port_run(); - - /* never reached */ - return NULL; -} -#endif -void nimble_riot_init(void) -{ #ifdef MODULE_NIMBLE_CONTROLLER /* XXX: NimBLE needs the nRF5x's LF clock to run */ #ifdef CPU_FAM_NRF52 clock_start_lf(); #endif - /* Run the controller * * Create task where NimBLE LL will run. This one is required as LL has its @@ -73,14 +64,21 @@ void nimble_riot_init(void) "nimble_ctrl"); #endif -#ifdef MODULE_NIMBLE_HOST + nimble_port_run(); + + /* never reached */ + return NULL; +} +#endif + +void nimble_riot_init(void) +{ /* and finally initialize and run the host */ thread_create(_stack_host, sizeof(_stack_host), NIMBLE_HOST_PRIO, THREAD_CREATE_STACKTEST, _host_thread, NULL, "nimble_host"); -#endif /* make sure synchronization of host and controller is done, this should * always be the case at this point */ diff --git a/pkg/nimble/patches/0001-L2CAP-sm-do-not-discard-alignment-information.patch b/pkg/nimble/patches/0001-L2CAP-sm-do-not-discard-alignment-information.patch deleted file mode 100644 index 7d8de78d278c..000000000000 --- a/pkg/nimble/patches/0001-L2CAP-sm-do-not-discard-alignment-information.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 5986ec94d49cb4121e37114def029255e2b73b05 Mon Sep 17 00:00:00 2001 -From: Juan Carrano -Date: Thu, 29 Nov 2018 13:40:36 +0100 -Subject: [PATCH] L2CAP sm: do not discard alignment information. - -ble_sm_gen_ediv and ble_sm_gen_master_id_rand took a simple pointer to -integers, but were being called with pointers to members of a packed -struct. This discarded the alignment information. - -Not only did it produce an error with clang's -Wno-address-of-packed-member, -but it may also cause an error in a platform with alignment requirements. - -The solution was to modify both procedures to take a pointer to the whole -structure instead of only the members. ---- - nimble/host/src/ble_sm.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c -index c2cf97aa..09b33bf5 100644 ---- a/nimble/host/src/ble_sm.c -+++ b/nimble/host/src/ble_sm.c -@@ -261,19 +261,19 @@ ble_sm_gen_pair_rand(uint8_t *pair_rand) - } - - static int --ble_sm_gen_ediv(uint16_t *ediv) -+ble_sm_gen_ediv(struct ble_sm_master_id *master_id) - { - int rc; - - #if MYNEWT_VAL(BLE_HS_DEBUG) - if (ble_sm_dbg_next_ediv_set) { - ble_sm_dbg_next_ediv_set = 0; -- *ediv = ble_sm_dbg_next_ediv; -+ master_id->ediv = ble_sm_dbg_next_ediv; - return 0; - } - #endif - -- rc = ble_hs_hci_util_rand(ediv, sizeof *ediv); -+ rc = ble_hs_hci_util_rand(&master_id->ediv, sizeof master_id->ediv); - if (rc != 0) { - return rc; - } -@@ -282,19 +282,19 @@ ble_sm_gen_ediv(uint16_t *ediv) - } - - static int --ble_sm_gen_master_id_rand(uint64_t *master_id_rand) -+ble_sm_gen_master_id_rand(struct ble_sm_master_id *master_id) - { - int rc; - - #if MYNEWT_VAL(BLE_HS_DEBUG) - if (ble_sm_dbg_next_master_id_rand_set) { - ble_sm_dbg_next_master_id_rand_set = 0; -- *master_id_rand = ble_sm_dbg_next_master_id_rand; -+ master_id->rand_val = ble_sm_dbg_next_master_id_rand; - return 0; - } - #endif - -- rc = ble_hs_hci_util_rand(master_id_rand, sizeof *master_id_rand); -+ rc = ble_hs_hci_util_rand(&master_id->rand_val, sizeof master_id->rand_val); - if (rc != 0) { - return rc; - } -@@ -2051,12 +2051,12 @@ ble_sm_key_exch_exec(struct ble_sm_proc *proc, struct ble_sm_result *res, - goto err; - } - -- rc = ble_sm_gen_ediv(&master_id->ediv); -+ rc = ble_sm_gen_ediv(master_id); - if (rc != 0) { - os_mbuf_free_chain(txom); - goto err; - } -- rc = ble_sm_gen_master_id_rand(&master_id->rand_val); -+ rc = ble_sm_gen_master_id_rand(master_id); - if (rc != 0) { - os_mbuf_free_chain(txom); - goto err; --- -2.19.2 -