nimble/controller: Remove callout for HCI Read Remote Features event

We don't need this callout - it's enough that we wait until end of conn
event and send an event from there.

X-Original-Commit: 75ba1ad07189835a309a8b71c44d2f34278ef33c
This commit is contained in:
Andrzej Kaczmarek
2017-07-05 11:36:33 +02:00
parent e26219dfb5
commit 28e54f55d2
3 changed files with 22 additions and 11 deletions
@@ -294,8 +294,6 @@ struct ble_ll_conn_sm
struct os_callout auth_pyld_timer;
#endif
struct os_callout rd_features_timer;
/*
* XXX: a note on all these structures for control procedures. First off,
* all of these need to be ifdef'd to save memory. Another thing to
+22 -7
View File
@@ -1916,11 +1916,6 @@ ble_ll_conn_sm_new(struct ble_ll_conn_sm *connsm)
connsm);
#endif
os_callout_init(&connsm->rd_features_timer,
&g_ble_ll_data.ll_evq,
ble_ll_conn_rd_features_timer_cb,
connsm);
ble_ll_conn_calc_itvl_ticks(connsm);
/* Add to list of active connections */
@@ -2006,8 +2001,6 @@ ble_ll_conn_end(struct ble_ll_conn_sm *connsm, uint8_t ble_err)
os_callout_stop(&connsm->auth_pyld_timer);
#endif
os_callout_stop(&connsm->rd_features_timer);
/* Remove from the active connection list */
SLIST_REMOVE(&g_ble_ll_conn_active_list, connsm, ble_ll_conn_sm, act_sle);
@@ -2036,6 +2029,16 @@ ble_ll_conn_end(struct ble_ll_conn_sm *connsm, uint8_t ble_err)
/* Connection state machine is now idle */
connsm->conn_state = BLE_LL_CONN_STATE_IDLE;
/*
* If we have features and there's pending HCI command, send an event before
* disconnection event so it does make sense to host.
*/
if (connsm->csmflags.cfbit.pending_hci_rd_features &&
connsm->csmflags.cfbit.rxd_features) {
ble_ll_hci_ev_rd_rem_used_feat(connsm, BLE_ERR_SUCCESS);
connsm->csmflags.cfbit.pending_hci_rd_features = 0;
}
/*
* We need to send a disconnection complete event or a connection complete
* event when the connection ends. We send a connection complete event
@@ -2054,8 +2057,13 @@ ble_ll_conn_end(struct ble_ll_conn_sm *connsm, uint8_t ble_err)
}
}
/*
* If there is still pending read features request HCI command, send an
* event to complete it.
*/
if (connsm->csmflags.cfbit.pending_hci_rd_features) {
ble_ll_hci_ev_rd_rem_used_feat(connsm, BLE_ERR_UNK_CONN_ID);
connsm->csmflags.cfbit.pending_hci_rd_features = 0;
}
/* Put connection state machine back on free list */
@@ -2533,6 +2541,13 @@ ble_ll_conn_event_end(struct os_event *ev)
/* If we have completed packets, send an event */
ble_ll_conn_num_comp_pkts_event_send(connsm);
/* If we have features and there's pending HCI command, send an event */
if (connsm->csmflags.cfbit.pending_hci_rd_features &&
connsm->csmflags.cfbit.rxd_features) {
ble_ll_hci_ev_rd_rem_used_feat(connsm, BLE_ERR_SUCCESS);
connsm->csmflags.cfbit.pending_hci_rd_features = 0;
}
}
/**
-2
View File
@@ -768,8 +768,6 @@ ble_ll_conn_hci_read_rem_features(uint8_t *cmdbuf)
connsm->csmflags.cfbit.pending_hci_rd_features = 1;
os_callout_reset(&connsm->rd_features_timer, 0);
return BLE_ERR_SUCCESS;
}