Commit da792a9e authored by Vinayak Kariappa Chettimada's avatar Vinayak Kariappa Chettimada Committed by Benjamin Cabé
Browse files

Bluetooth: Controller: Fix interleaved extended scanning assert



Fix interleaved extended scanning assert.

Signed-off-by: default avatarVinayak Kariappa Chettimada <vich@nordicsemi.no>
parent 00e8cdcc
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -351,8 +351,18 @@ struct node_rx_ftr {
				* chaining, to reserve node_rx for CSA#2 event
				* generation etc.
				*/
		void *aux_ptr;
		uint8_t aux_phy;
		void *lll_aux; /* LLL scheduled auxiliary context associated to
				* the scan context when enqueuing the node rx.
				* This does not overlap the below aux_ptr or
				* aux_phy which are used before enqueue when
				* setting up LLL scheduling.
				*/
		void *aux_ptr; /* aux pointer stored when LLL scheduling the
				* auxiliary PDU reception by scan context.
				*/
		uint8_t aux_phy; /* aux phy stored when LLL scheduling the
				  * auxiliary PDU reception by scan context.
				  */
		struct cte_conn_iq_report *iq_report;
	};
	uint32_t ticks_anchor;
@@ -531,9 +541,9 @@ struct event_done_extra {
	*/
				};

#if defined(CONFIG_BT_CTLR_ADV_EXT)
#if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS)
				void *lll;
#endif /* CONFIG_BT_CTLR_ADV_EXT */
#endif /* CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */
			};

#if defined(CONFIG_BT_CTLR_LE_ENC)
+11 −0
Original line number Diff line number Diff line
@@ -676,7 +676,10 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param)

	e = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN_AUX);
	LL_ASSERT(e);

#if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS)
	e->lll = param;
#endif /* CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */

	lll_done(param);
}
@@ -716,7 +719,10 @@ static void isr_done(void *param)

		e = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN_AUX);
		LL_ASSERT(e);

#if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS)
		e->lll = param;
#endif /* CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */
	}

	lll_isr_cleanup(param);
@@ -1209,6 +1215,7 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux,
			lll_aux->state = 1U;
		} else {
			ftr->param = lll;
			ftr->lll_aux = lll->lll_aux;
			radio_isr_set(isr_tx_scan_req_lll_schedule,
				      node_rx);
			lll->lll_aux->state = 1U;
@@ -1278,6 +1285,7 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux,
			 * LLL scheduling in the reception of this current PDU.
			 */
			ftr->param = lll;
			ftr->lll_aux = lll->lll_aux;
			ftr->scan_rsp = lll->lll_aux->state;

			/* Further auxiliary PDU reception will be chain PDUs */
@@ -1661,7 +1669,10 @@ static void isr_early_abort(void *param)

	e = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN_AUX);
	LL_ASSERT(e);

#if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS)
	e->lll = param;
#endif /* CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */

	lll_isr_early_abort(param);
}
+8 −4
Original line number Diff line number Diff line
@@ -268,13 +268,17 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx)
			sync_lll = NULL;

			/* Node that does not have valid aux context but has
			 * valid scan set was scheduled from LLL. We can
			 * retrieve aux context from lll_scan as it was stored
			 * there when superior PDU was handled.
			 * valid scan set was scheduled from LLL.
			 */
			lll = ftr->param;

			lll_aux = lll->lll_aux;
			/* We can not retrieve aux context that was stored in
			 * lll_scan when superior PDU was handled, as it may be
			 * reset to NULL before this node rx is processed here.
			 * The reset happens when new extended advertising chain
			 * is being received before we process the node here.
			 */
			lll_aux = ftr->lll_aux;
			LL_ASSERT(lll_aux);

			aux = HDR_LLL2ULL(lll_aux);