nimble/ll: Use uint64_t for features

In Bluetooth 5.2 more than 32 bits are used for the supported
features, therefore let us use uint64_t from now on.
This commit is contained in:
Łukasz Rymanowski
2020-01-28 10:43:19 +01:00
parent a353136211
commit b018a1a71b
3 changed files with 8 additions and 10 deletions
@@ -80,7 +80,7 @@ STAILQ_HEAD(ble_ll_pkt_q, os_mbuf_pkthdr);
struct ble_ll_obj
{
/* Supported features */
uint32_t ll_supp_features;
uint64_t ll_supp_features;
/* Current Link Layer state */
uint8_t ll_state;
@@ -517,7 +517,7 @@ int ble_ll_set_random_addr(const uint8_t *cmdbuf, uint8_t len, bool hci_adv_ext)
void ble_ll_wfr_timer_exp(void *arg);
/* Read set of features supported by the Link Layer */
uint32_t ble_ll_read_supp_features(void);
uint64_t ble_ll_read_supp_features(void);
/* Read set of states supported by the Link Layer */
uint64_t ble_ll_read_supp_states(void);
+3 -3
View File
@@ -1269,9 +1269,9 @@ ble_ll_read_supp_states(void)
/**
* Returns the features supported by the link layer
*
* @return uint32_t bitmask of supported features.
* @return uint64_t bitmask of supported features.
*/
uint32_t
uint64_t
ble_ll_read_supp_features(void)
{
return g_ble_ll_data.ll_supp_features;
@@ -1515,7 +1515,7 @@ void
ble_ll_init(void)
{
int rc;
uint32_t features;
uint64_t features;
ble_addr_t addr;
struct ble_ll_obj *lldata;
+3 -5
View File
@@ -1804,7 +1804,7 @@ ble_ll_ctrl_rx_feature_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
uint8_t *rspbuf, uint8_t opcode)
{
uint8_t rsp_opcode;
uint32_t our_feat;
uint64_t our_feat;
/*
* Only accept slave feature requests if we are a master and feature
@@ -1837,8 +1837,7 @@ ble_ll_ctrl_rx_feature_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
*/
connsm->conn_features &= our_feat;
memset(rspbuf + 1, 0, 8);
put_le32(rspbuf + 1, our_feat);
put_le64(rspbuf + 1, our_feat);
rspbuf[1] = connsm->conn_features;
return rsp_opcode;
@@ -2092,8 +2091,7 @@ ble_ll_ctrl_proc_init(struct ble_ll_conn_sm *connsm, int ctrl_proc)
} else {
opcode = BLE_LL_CTRL_SLAVE_FEATURE_REQ;
}
memset(ctrdata, 0, BLE_LL_CTRL_FEATURE_LEN);
put_le32(ctrdata, ble_ll_read_supp_features());
put_le64(ctrdata, ble_ll_read_supp_features());
break;
case BLE_LL_CTRL_PROC_VERSION_XCHG:
opcode = BLE_LL_CTRL_VERSION_IND;