Commit cf2af8bf authored by Vinayak Kariappa Chettimada's avatar Vinayak Kariappa Chettimada Committed by Carles Cufi
Browse files

Bluetooth: Controller: Fix endianness between CPU and PDU contents



Fix missing endianness conversion between CPU and PDU
contents assignments.

Signed-off-by: default avatarVinayak Kariappa Chettimada <vich@nordicsemi.no>
parent 4fe004c5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -6420,7 +6420,8 @@ static void le_big_sync_established(struct pdu_data *pdu,
	sep->bn = lll->bn;
	sep->pto = lll->pto;
	sep->irc = lll->irc;
	sep->max_pdu = lll->max_pdu;
	sep->max_pdu = sys_cpu_to_le16(lll->max_pdu);
	sep->iso_interval = sys_cpu_to_le16(sync_iso->iso_interval);
	sep->num_bis = lll->num_bis;

	/* TODO: Connection handle list of all BISes in the BIG */
@@ -6509,7 +6510,7 @@ static void le_big_complete(struct pdu_data *pdu_data,
	sep->bn = lll->bn;
	sep->pto = lll->pto;
	sep->irc = lll->irc;
	sep->max_pdu = lll->max_pdu;
	sep->max_pdu = sys_cpu_to_le16(lll->max_pdu);
	sep->num_bis = lll->num_bis;

	/* TODO: Connection handle list of all BISes in the BIG */
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include <stdint.h>

#include <soc.h>
#include <sys/byteorder.h>

#include "hal/cpu.h"
#include "hal/ccm.h"
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include <stdint.h>

#include <soc.h>
#include <sys/byteorder.h>

#include "hal/cpu.h"
#include "hal/ccm.h"
+8 −6
Original line number Diff line number Diff line
@@ -329,18 +329,19 @@ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
	 * advertising event.
	 */

	big_info->iso_interval = iso_interval_us / 1250U;
	big_info->iso_interval =
		sys_cpu_to_le16(iso_interval_us / CONN_INT_UNIT_US);
	big_info->num_bis = lll_adv_iso->num_bis;
	big_info->nse = lll_adv_iso->nse;
	big_info->bn = lll_adv_iso->bn;
	big_info->sub_interval = lll_adv_iso->sub_interval;
	big_info->sub_interval = sys_cpu_to_le24(lll_adv_iso->sub_interval);
	big_info->pto = lll_adv_iso->pto;
	big_info->spacing = lll_adv_iso->bis_spacing;
	big_info->spacing = sys_cpu_to_le24(lll_adv_iso->bis_spacing);
	big_info->irc = lll_adv_iso->irc;
	big_info->max_pdu = lll_adv_iso->max_pdu;
	memcpy(&big_info->seed_access_addr, lll_adv_iso->seed_access_addr,
	       sizeof(big_info->seed_access_addr));
	big_info->sdu_interval = sdu_interval;
	big_info->sdu_interval = sys_cpu_to_le24(sdu_interval);
	big_info->max_sdu = max_sdu;
	memcpy(&big_info->base_crc_init, lll_adv_iso->base_crc_init,
	       sizeof(big_info->base_crc_init));
@@ -805,10 +806,11 @@ static inline void big_info_offset_fill(struct pdu_big_info *bi,
	offs = HAL_TICKER_TICKS_TO_US(ticks_offset) - start_us;
	offs = offs / OFFS_UNIT_30_US;
	if (!!(offs >> 13)) {
		bi->offs = offs / (OFFS_UNIT_300_US / OFFS_UNIT_30_US);
		bi->offs = sys_cpu_to_le16(offs / (OFFS_UNIT_300_US /
						   OFFS_UNIT_30_US));
		bi->offs_units = 1U;
	} else {
		bi->offs = offs;
		bi->offs = sys_cpu_to_le16(offs);
		bi->offs_units = 0U;
	}
}
+3 −2
Original line number Diff line number Diff line
@@ -1680,10 +1680,11 @@ static inline void sync_info_offset_fill(struct pdu_adv_sync_info *si,
	offs = HAL_TICKER_TICKS_TO_US(ticks_offset) - start_us;
	offs = offs / OFFS_UNIT_30_US;
	if (!!(offs >> OFFS_UNIT_BITS)) {
		si->offs = offs / (OFFS_UNIT_300_US / OFFS_UNIT_30_US);
		si->offs = sys_cpu_to_le16(offs / (OFFS_UNIT_300_US /
						   OFFS_UNIT_30_US));
		si->offs_units = OFFS_UNIT_VALUE_300_US;
	} else {
		si->offs = offs;
		si->offs = sys_cpu_to_le16(offs);
		si->offs_units = OFFS_UNIT_VALUE_30_US;
	}
}
Loading