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
|
@ -76,21 +76,20 @@
|
|||
/* CRC polynomial */
|
||||
#define PDU_CRC_POLYNOMIAL ((0x5bUL) | ((0x06UL) << 8) | ((0x00UL) << 16))
|
||||
|
||||
/* Data channel minimum payload size and time */
|
||||
#define PDU_DC_PAYLOAD_SIZE_MIN 27
|
||||
#define PDU_DC_PAYLOAD_TIME_MIN 328
|
||||
/* Data channel minimum payload size and time in us */
|
||||
#define PDU_DC_PAYLOAD_SIZE_MIN 27
|
||||
#define PDU_DC_PAYLOAD_TIME_MIN 328
|
||||
#define PDU_DC_PAYLOAD_TIME_MIN_CODED 2704
|
||||
|
||||
/* Data channel maximum payload size and time */
|
||||
#define PDU_DC_PAYLOAD_SIZE_MAX 251
|
||||
/* Data channel maximum payload size and time in us */
|
||||
#define PDU_DC_PAYLOAD_SIZE_MAX 251
|
||||
#define PDU_DC_PAYLOAD_TIME_MAX_CODED 17040
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_DF)
|
||||
#define PDU_DC_PAYLOAD_TIME_MAX 2128
|
||||
#else
|
||||
#define PDU_DC_PAYLOAD_TIME_MAX 2120
|
||||
#endif
|
||||
|
||||
#define PDU_DC_PAYLOAD_TIME_MAX_CODED 17040
|
||||
#define PDU_DC_PAYLOAD_TIME_MAX 2128
|
||||
#else /* !CONFIG_BT_CTLR_DF */
|
||||
#define PDU_DC_PAYLOAD_TIME_MAX 2120
|
||||
#endif /* !CONFIG_BT_CTLR_DF */
|
||||
|
||||
/* Link Layer header size of Data PDU. Assumes pdu_data is packed */
|
||||
#define PDU_DC_LL_HEADER_SIZE (offsetof(struct pdu_data, lldata))
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -45,7 +45,7 @@ LL/CON/CEN/BV-41-C
|
|||
LL/CON/CEN/BV-43-C
|
||||
LL/CON/CEN/BV-73-C
|
||||
LL/CON/CEN/BV-74-C
|
||||
LL/CON/CEN/BV-76-C
|
||||
#LL/CON/CEN/BV-76-C # Needs testcase implementation update
|
||||
LL/CON/CEN/BV-77-C
|
||||
LL/CON/PER/BI-08-C
|
||||
LL/CON/PER/BV-04-C
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue