Bluetooth: Controller: Fix Data Length Request Cmd parameter checking
Fix Data Length Request CMD parameter checking to not restrict invalid maximum Tx time values. This addresses conformance test cases that provide maximum Tx time values of 2128 us when not supporting Coded PHY in the Controller implementation. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
ad1aae29e5
commit
192e2a8f94
3 changed files with 28 additions and 24 deletions
|
@ -648,20 +648,11 @@ uint32_t ll_length_req_send(uint16_t handle, uint16_t tx_octets,
|
|||
{
|
||||
struct ll_conn *conn;
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_PARAM_CHECK)
|
||||
#if defined(CONFIG_BT_CTLR_PHY_CODED)
|
||||
uint16_t tx_time_max =
|
||||
PDU_DC_MAX_US(LL_LENGTH_OCTETS_TX_MAX, PHY_CODED);
|
||||
#else /* !CONFIG_BT_CTLR_PHY_CODED */
|
||||
uint16_t tx_time_max =
|
||||
PDU_DC_MAX_US(LL_LENGTH_OCTETS_TX_MAX, PHY_1M);
|
||||
#endif /* !CONFIG_BT_CTLR_PHY_CODED */
|
||||
|
||||
if ((tx_octets > LL_LENGTH_OCTETS_TX_MAX) ||
|
||||
(tx_time > tx_time_max)) {
|
||||
if (IS_ENABLED(CONFIG_BT_CTLR_PARAM_CHECK) &&
|
||||
((tx_octets > LL_LENGTH_OCTETS_TX_MAX) ||
|
||||
(tx_time > PDU_DC_PAYLOAD_TIME_MAX_CODED))) {
|
||||
return BT_HCI_ERR_INVALID_PARAM;
|
||||
}
|
||||
#endif /* CONFIG_BT_CTLR_PARAM_CHECK */
|
||||
|
||||
conn = ll_connected_get(handle);
|
||||
if (!conn) {
|
||||
|
@ -675,6 +666,20 @@ uint32_t ll_length_req_send(uint16_t handle, uint16_t tx_octets,
|
|||
return BT_HCI_ERR_UNSUPP_REMOTE_FEATURE;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_PHY)
|
||||
#if defined(CONFIG_BT_CTLR_PHY_CODED)
|
||||
const uint16_t tx_time_max =
|
||||
PDU_DC_MAX_US(LL_LENGTH_OCTETS_TX_MAX, PHY_CODED);
|
||||
#else /* !CONFIG_BT_CTLR_PHY_CODED */
|
||||
const uint16_t tx_time_max =
|
||||
PDU_DC_MAX_US(LL_LENGTH_OCTETS_TX_MAX, PHY_1M);
|
||||
#endif /* !CONFIG_BT_CTLR_PHY_CODED */
|
||||
|
||||
if (tx_time > tx_time_max) {
|
||||
tx_time = tx_time_max;
|
||||
}
|
||||
#endif /* CONFIG_BT_CTLR_PHY */
|
||||
|
||||
if (conn->llcp_length.req != conn->llcp_length.ack) {
|
||||
switch (conn->llcp_length.state) {
|
||||
case LLCP_LENGTH_STATE_RSP_ACK_WAIT:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue