andrzej-kaczmarek commented on a change in pull request #931:
URL: https://github.com/apache/mynewt-nimble/pull/931#discussion_r718667525



##########
File path: nimble/controller/src/ble_ll_scan.c
##########
@@ -2388,48 +2109,31 @@ ble_ll_scan_rx_isr_end(struct os_mbuf *rxpdu, uint8_t 
crcok)
         return 0;
     }
 
-    rxbuf = rxpdu->om_data;
-    pdu_type = rxbuf[0] & BLE_ADV_PDU_HDR_TYPE_MASK;
-
-#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
-    /*
-     * In case aux was expected, copy aux_data for LL to use. Make sure this 
was
-     * indeed an aux as otherwise there's no need to process it and just pass 
to
-     * LL immediately.
-     */
-    if (scansm->cur_aux_data) {
-        rxinfo->user_data = scansm->cur_aux_data;
-        scansm->cur_aux_data = NULL;
-        if (pdu_type != BLE_ADV_PDU_TYPE_ADV_EXT_IND) {
-            ble_ll_state_set(BLE_LL_STATE_STANDBY);
-            return -1;
-        }
-    }
-#endif
-
     if (!crcok) {
         goto scan_rx_isr_ignore;
     }
 
-    /*
-     * Addresses will be always set in handlers, no need to initialize them. We
-     * only need to initialize rl which may not be always set, depending on how
-     * filtering goes.
-     */
-    addrd.rl = NULL;
+    rxbuf = rxpdu->om_data;
+    pdu_type = rxbuf[0] & BLE_ADV_PDU_HDR_TYPE_MASK;
 
     switch (pdu_type) {
     case BLE_ADV_PDU_TYPE_ADV_IND:
     case BLE_ADV_PDU_TYPE_ADV_DIRECT_IND:
     case BLE_ADV_PDU_TYPE_ADV_NONCONN_IND:
-    case BLE_ADV_PDU_TYPE_SCAN_RSP:
     case BLE_ADV_PDU_TYPE_ADV_SCAN_IND:
-        rc = ble_ll_scan_rx_isr_on_legacy(pdu_type, rxbuf, hdr, &addrd);
+        rc = ble_ll_scan_rx_isr_on_adv(pdu_type, rxbuf, hdr, &addrd);
+        break;
+    case BLE_ADV_PDU_TYPE_SCAN_RSP:
+        rc = ble_ll_scan_rx_isr_on_scan_rsp(pdu_type, rxbuf, hdr, &addrd);
         break;
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
     case BLE_ADV_PDU_TYPE_ADV_EXT_IND:
-        rc = ble_ll_scan_rx_isr_on_aux(pdu_type, rxbuf, hdr, &addrd);
-        break;
+        rc = ble_ll_scan_aux_rx_isr_end_on_ext(&g_ble_ll_scan_sm, rxpdu);
+        if (rc < 0) {
+            rxinfo->flags |= BLE_MBUF_HDR_F_IGNORED;
+        }
+        ble_ll_state_set(BLE_LL_STATE_STANDBY);
+        return -1;

Review comment:
       yes, returning -1 will disable phy since we do not need to send anything 
back on ext.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to