Bluetooth: controller: Use 24-bit functions for LL Features
Use 24-bit functions for LL Features copying to make byteorder more readable. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
6426cd58fc
commit
f675e14718
3 changed files with 13 additions and 39 deletions
|
@ -787,9 +787,7 @@ static void le_read_local_features(struct net_buf *buf, struct net_buf **evt)
|
|||
rp->status = 0x00;
|
||||
|
||||
(void)memset(&rp->features[0], 0x00, sizeof(rp->features));
|
||||
rp->features[0] = LL_FEAT & 0xFF;
|
||||
rp->features[1] = (LL_FEAT >> 8) & 0xFF;
|
||||
rp->features[2] = (LL_FEAT >> 16) & 0xFF;
|
||||
sys_put_le24(LL_FEAT, rp->features);
|
||||
}
|
||||
|
||||
static void le_set_random_address(struct net_buf *buf, struct net_buf **evt)
|
||||
|
|
|
@ -7915,12 +7915,8 @@ static inline void event_fex_prep(struct connection *conn)
|
|||
pdu_ctrl_rx->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_FEATURE_RSP;
|
||||
(void)memset(&pdu_ctrl_rx->llctrl.feature_rsp.features[0], 0x00,
|
||||
sizeof(pdu_ctrl_rx->llctrl.feature_rsp.features));
|
||||
pdu_ctrl_rx->llctrl.feature_req.features[0] =
|
||||
conn->llcp_feature.features & 0xFF;
|
||||
pdu_ctrl_rx->llctrl.feature_req.features[1] =
|
||||
(conn->llcp_feature.features >> 8) & 0xFF;
|
||||
pdu_ctrl_rx->llctrl.feature_req.features[2] =
|
||||
(conn->llcp_feature.features >> 16) & 0xFF;
|
||||
sys_put_le24(conn->llcp_feature.features,
|
||||
pdu_ctrl_rx->llctrl.feature_req.features);
|
||||
|
||||
/* enqueue feature rsp structure into rx queue */
|
||||
packet_rx_enqueue();
|
||||
|
@ -7950,12 +7946,8 @@ static inline void event_fex_prep(struct connection *conn)
|
|||
(void)memset(&pdu_ctrl_tx->llctrl.feature_req.features[0],
|
||||
0x00,
|
||||
sizeof(pdu_ctrl_tx->llctrl.feature_req.features));
|
||||
pdu_ctrl_tx->llctrl.feature_req.features[0] =
|
||||
conn->llcp_feature.features & 0xFF;
|
||||
pdu_ctrl_tx->llctrl.feature_req.features[1] =
|
||||
(conn->llcp_feature.features >> 8) & 0xFF;
|
||||
pdu_ctrl_tx->llctrl.feature_req.features[2] =
|
||||
(conn->llcp_feature.features >> 16) & 0xFF;
|
||||
sys_put_le24(conn->llcp_feature.features,
|
||||
pdu_ctrl_tx->llctrl.feature_req.features);
|
||||
|
||||
ctrl_tx_enqueue(conn, node_tx);
|
||||
|
||||
|
@ -10851,12 +10843,8 @@ static u8_t feature_rsp_send(struct connection *conn,
|
|||
pdu_ctrl_tx->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_FEATURE_RSP;
|
||||
(void)memset(&pdu_ctrl_tx->llctrl.feature_rsp.features[0], 0x00,
|
||||
sizeof(pdu_ctrl_tx->llctrl.feature_rsp.features));
|
||||
pdu_ctrl_tx->llctrl.feature_req.features[0] =
|
||||
conn->llcp_feature.features & 0xFF;
|
||||
pdu_ctrl_tx->llctrl.feature_req.features[1] =
|
||||
(conn->llcp_feature.features >> 8) & 0xFF;
|
||||
pdu_ctrl_tx->llctrl.feature_req.features[2] =
|
||||
(conn->llcp_feature.features >> 16) & 0xFF;
|
||||
sys_put_le24(conn->llcp_feature.features,
|
||||
pdu_ctrl_tx->llctrl.feature_req.features);
|
||||
|
||||
ctrl_tx_sec_enqueue(conn, node_tx);
|
||||
|
||||
|
|
|
@ -2695,12 +2695,8 @@ static inline void event_fex_prep(struct ll_conn *conn)
|
|||
pdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_FEATURE_RSP;
|
||||
(void)memset(&pdu->llctrl.feature_rsp.features[0], 0x00,
|
||||
sizeof(pdu->llctrl.feature_rsp.features));
|
||||
pdu->llctrl.feature_req.features[0] =
|
||||
conn->llcp_feature.features & 0xFF;
|
||||
pdu->llctrl.feature_req.features[1] =
|
||||
(conn->llcp_feature.features >> 8) & 0xFF;
|
||||
pdu->llctrl.feature_req.features[2] =
|
||||
(conn->llcp_feature.features >> 16) & 0xFF;
|
||||
sys_put_le24(conn->llcp_feature.features,
|
||||
pdu->llctrl.feature_req.features);
|
||||
|
||||
/* enqueue feature rsp structure into rx queue */
|
||||
ll_rx_put(rx->hdr.link, rx);
|
||||
|
@ -2729,12 +2725,8 @@ static inline void event_fex_prep(struct ll_conn *conn)
|
|||
(void)memset(&pdu->llctrl.feature_req.features[0],
|
||||
0x00,
|
||||
sizeof(pdu->llctrl.feature_req.features));
|
||||
pdu->llctrl.feature_req.features[0] =
|
||||
conn->llcp_feature.features & 0xFF;
|
||||
pdu->llctrl.feature_req.features[1] =
|
||||
(conn->llcp_feature.features >> 8) & 0xFF;
|
||||
pdu->llctrl.feature_req.features[2] =
|
||||
(conn->llcp_feature.features >> 16) & 0xFF;
|
||||
sys_put_le24(conn->llcp_feature.features,
|
||||
pdu->llctrl.feature_req.features);
|
||||
|
||||
ctrl_tx_enqueue(conn, tx);
|
||||
|
||||
|
@ -3987,12 +3979,8 @@ static int feature_rsp_send(struct ll_conn *conn, struct node_rx_pdu *rx,
|
|||
pdu_tx->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_FEATURE_RSP;
|
||||
(void)memset(&pdu_tx->llctrl.feature_rsp.features[0], 0x00,
|
||||
sizeof(pdu_tx->llctrl.feature_rsp.features));
|
||||
pdu_tx->llctrl.feature_req.features[0] =
|
||||
conn->llcp_feature.features & 0xFF;
|
||||
pdu_tx->llctrl.feature_req.features[1] =
|
||||
(conn->llcp_feature.features >> 8) & 0xFF;
|
||||
pdu_tx->llctrl.feature_req.features[2] =
|
||||
(conn->llcp_feature.features >> 16) & 0xFF;
|
||||
sys_put_le24(conn->llcp_feature.features,
|
||||
pdu_tx->llctrl.feature_req.features);
|
||||
|
||||
ctrl_tx_sec_enqueue(conn, tx);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue