rymanluk closed pull request #239: nimble/ll: Certification fixes part 4
URL: https://github.com/apache/mynewt-nimble/pull/239
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/nimble/controller/src/ble_ll_conn.c
b/nimble/controller/src/ble_ll_conn.c
index 4b6704db..26090e50 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -3924,8 +3924,9 @@ ble_ll_conn_rx_isr_end(uint8_t *rxbuf, struct
ble_mbuf_hdr *rxhdr)
&& (rx_pyld_len == (1 + BLE_LL_CTRL_TERMINATE_IND_LEN))) {
connsm->csmflags.cfbit.terminate_ind_rxd = 1;
connsm->rxd_disconnect_reason = rxbuf[3];
- reply = 1;
- } else if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+ }
+
+ if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
reply = CONN_F_LAST_TXD_MD(connsm) || (hdr_byte &
BLE_LL_DATA_HDR_MD_MASK);
} else {
/* A slave always replies */
diff --git a/nimble/controller/src/ble_ll_ctrl.c
b/nimble/controller/src/ble_ll_ctrl.c
index 0dc6a785..108fb158 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -874,6 +874,8 @@ ble_ll_ctrl_rx_phy_rsp(struct ble_ll_conn_sm *connsm,
uint8_t *dptr,
*
* XXX: TODO count some stat?
*/
+ } else {
+ rsp_opcode = BLE_LL_CTRL_UNKNOWN_RSP;
}
/* NOTE: slave should never receive one of these */
@@ -1261,7 +1263,7 @@ ble_ll_ctrl_rx_enc_req(struct ble_ll_conn_sm *connsm,
uint8_t *dptr,
uint8_t *rspdata)
{
if (connsm->conn_role != BLE_LL_CONN_ROLE_SLAVE) {
- return BLE_ERR_MAX;
+ return BLE_LL_CTRL_UNKNOWN_RSP;
}
/* In case we were already encrypted we need to reset packet counters */
@@ -1309,6 +1311,8 @@ ble_ll_ctrl_rx_start_enc_req(struct ble_ll_conn_sm
*connsm)
connsm->enc_data.enc_state = CONN_ENC_S_START_ENC_RSP_WAIT;
rc = BLE_LL_CTRL_START_ENC_RSP;
}
+ } else {
+ rc = BLE_LL_CTRL_UNKNOWN_RSP;
}
return rc;
}
@@ -1327,6 +1331,8 @@ ble_ll_ctrl_rx_pause_enc_req(struct ble_ll_conn_sm
*connsm)
if ((connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) &&
(connsm->enc_data.enc_state == CONN_ENC_S_ENCRYPTED)) {
rc = BLE_LL_CTRL_PAUSE_ENC_RSP;
+ } else {
+ rc = BLE_LL_CTRL_UNKNOWN_RSP;
}
return rc;
@@ -1345,9 +1351,10 @@ ble_ll_ctrl_rx_pause_enc_rsp(struct ble_ll_conn_sm
*connsm)
{
int rc;
- rc = BLE_ERR_MAX;
if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
rc = BLE_LL_CTRL_PAUSE_ENC_RSP;
+ } else {
+ rc = BLE_LL_CTRL_UNKNOWN_RSP;
}
return rc;
@@ -1789,7 +1796,7 @@ ble_ll_ctrl_rx_conn_param_rsp(struct ble_ll_conn_sm
*connsm, uint8_t *dptr,
/* A slave should never receive this response */
if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
- return BLE_ERR_MAX;
+ return BLE_LL_CTRL_UNKNOWN_RSP;
}
/*
@@ -2248,6 +2255,9 @@ ble_ll_ctrl_rx_pdu(struct ble_ll_conn_sm *connsm, struct
os_mbuf *om)
case BLE_LL_CTRL_PHY_REQ:
feature = BLE_LL_FEAT_LE_2M_PHY | BLE_LL_FEAT_LE_CODED_PHY;
break;
+ case BLE_LL_CTRL_MIN_USED_CHAN_IND:
+ feature = BLE_LL_FEAT_MIN_USED_CHAN;
+ break;
default:
feature = 0;
break;
diff --git a/nimble/controller/src/ble_ll_scan.c
b/nimble/controller/src/ble_ll_scan.c
index 8b484913..901fa184 100644
--- a/nimble/controller/src/ble_ll_scan.c
+++ b/nimble/controller/src/ble_ll_scan.c
@@ -2122,7 +2122,8 @@ ble_ll_scan_rx_isr_end(struct os_mbuf *rxpdu, uint8_t
crcok)
goto scan_rx_isr_exit;
}
- if (ext_adv_mode == BLE_LL_EXT_ADV_MODE_SCAN) {
+ if ((ext_adv_mode == BLE_LL_EXT_ADV_MODE_SCAN) &&
+ (scanphy->scan_type == BLE_SCAN_TYPE_ACTIVE)) {
chk_send_req = 1;
}
chk_wl = 1;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services