nimble/l2cap: Rename MYNEWT_VAL flag for L2CAP MPS

According to Bluetooth specification 5.0 Vol 3. Part A 4.23, in the
context of CoC this value is used to configure MPS and not MTU.
This commit is contained in:
Łukasz Rymanowski
2019-03-25 22:40:32 +01:00
parent c6ce9930c1
commit 286ae23d4e
7 changed files with 18 additions and 19 deletions
+2 -2
View File
@@ -73,8 +73,8 @@ syscfg.vals:
RTT_NUM_BUFFERS_DOWN: 1
BLE_L2CAP_COC_MAX_NUM: 2
# Some testcases require MPS < MTU (MPS == COC_MTU, MTU == application MTU)
BLE_L2CAP_COC_MTU: 100
# Some testcases require MPS < MTU
BLE_L2CAP_COC_MPS: 100
BLE_RPA_TIMEOUT: 10
BLE_SM_BONDING: 1
BLE_SM_MITM: 1
+1 -1
View File
@@ -247,7 +247,7 @@ ble_l2cap_coc_chan_alloc(uint16_t conn_handle, uint16_t psm, uint16_t mtu,
chan->cb = cb;
chan->cb_arg = cb_arg;
chan->scid = ble_l2cap_coc_get_cid();
chan->my_mtu = MYNEWT_VAL(BLE_L2CAP_COC_MTU);
chan->my_mtu = MYNEWT_VAL(BLE_L2CAP_COC_MPS);
chan->rx_fn = ble_l2cap_coc_rx_fn;
chan->coc_rx.mtu = mtu;
chan->coc_rx.sdu = sdu_rx;
+3 -4
View File
@@ -110,11 +110,10 @@ syscfg.defs:
Defines maximum number of LE Connection Oriented Channels channels.
When set to (0), LE COC is not compiled in.
value: 0
BLE_L2CAP_COC_MTU:
BLE_L2CAP_COC_MPS:
description: >
Defines the MTU size used internally by the L2CAP COC module for
transferring data from user provided buffers into NimBLE's internal
buffer. The default MTU size is chosen in a way, that the MTU plus
Defines the MPS of L2CAP COC module. This is actually NimBLE's internal
L2CAP MTU. The default MPS size is chosen in a way, that the MPS plus
the required HCI and L2CAP headers fit into the smallest available
MSYS blocks.
value: 'MYNEWT_VAL_MSYS_1_BLOCK_SIZE-8'
+6 -6
View File
@@ -783,8 +783,8 @@ ble_l2cap_test_coc_connect(struct test_data *t)
req.credits = htole16(
ble_l2cap_calculate_credits(t->mtu,
MYNEWT_VAL(BLE_L2CAP_COC_MTU)));
req.mps = htole16(MYNEWT_VAL(BLE_L2CAP_COC_MTU));
MYNEWT_VAL(BLE_L2CAP_COC_MPS)));
req.mps = htole16(MYNEWT_VAL(BLE_L2CAP_COC_MPS));
req.mtu = htole16(t->mtu);
req.psm = htole16(t->psm);
req.scid = htole16(current_cid++);
@@ -798,7 +798,7 @@ ble_l2cap_test_coc_connect(struct test_data *t)
* only*/
rsp.credits = htole16(10);
rsp.dcid = htole16(current_cid);
rsp.mps = htole16(MYNEWT_VAL(BLE_L2CAP_COC_MTU) + 16);
rsp.mps = htole16(MYNEWT_VAL(BLE_L2CAP_COC_MPS) + 16);
rsp.mtu = htole16(t->mtu);
rsp.result = htole16(ev->l2cap_status);
@@ -825,7 +825,7 @@ ble_l2cap_test_coc_connect_by_peer(struct test_data *t)
/* Use some different parameters for peer */
req.credits = htole16(30);
req.mps = htole16(MYNEWT_VAL(BLE_L2CAP_COC_MTU) + 16);
req.mps = htole16(MYNEWT_VAL(BLE_L2CAP_COC_MPS) + 16);
req.mtu = htole16(t->mtu);
req.psm = htole16(t->psm);
req.scid = htole16(0x0040);
@@ -849,9 +849,9 @@ ble_l2cap_test_coc_connect_by_peer(struct test_data *t)
/* Receive response from peer.*/
rsp.credits = htole16(
ble_l2cap_calculate_credits(t->mtu,
MYNEWT_VAL(BLE_L2CAP_COC_MTU)));
MYNEWT_VAL(BLE_L2CAP_COC_MPS)));
rsp.dcid = current_cid++;
rsp.mps = htole16(MYNEWT_VAL(BLE_L2CAP_COC_MTU));
rsp.mps = htole16(MYNEWT_VAL(BLE_L2CAP_COC_MPS));
rsp.mtu = htole16(t->mtu);
}
@@ -605,8 +605,8 @@
#define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (1)
#endif
#ifndef MYNEWT_VAL_BLE_L2CAP_COC_MTU
#define MYNEWT_VAL_BLE_L2CAP_COC_MTU (MYNEWT_VAL_MSYS_1_BLOCK_SIZE - 8)
#ifndef MYNEWT_VAL_BLE_L2CAP_COC_MPS
#define MYNEWT_VAL_BLE_L2CAP_COC_MPS (MYNEWT_VAL_MSYS_1_BLOCK_SIZE - 8)
#endif
#ifndef MYNEWT_VAL_BLE_L2CAP_JOIN_RX_FRAGS
@@ -621,8 +621,8 @@
#define MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS (1)
#endif
#ifndef MYNEWT_VAL_BLE_L2CAP_COC_MTU
#define MYNEWT_VAL_BLE_L2CAP_COC_MTU (MYNEWT_VAL_MSYS_1_BLOCK_SIZE-8)
#ifndef MYNEWT_VAL_BLE_L2CAP_COC_MPS
#define MYNEWT_VAL_BLE_L2CAP_COC_MPS (MYNEWT_VAL_MSYS_1_BLOCK_SIZE - 8)
#endif
/* Overridden by apps/bleall (defined by net/nimble/host) */
+2 -2
View File
@@ -809,8 +809,8 @@
#define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (0)
#endif
#ifndef MYNEWT_VAL_BLE_L2CAP_COC_MTU
#define MYNEWT_VAL_BLE_L2CAP_COC_MTU (MYNEWT_VAL_MSYS_1_BLOCK_SIZE - 8)
#ifndef MYNEWT_VAL_BLE_L2CAP_COC_MPS
#define MYNEWT_VAL_BLE_L2CAP_COC_MPS (MYNEWT_VAL_MSYS_1_BLOCK_SIZE - 8)
#endif
#ifndef MYNEWT_VAL_BLE_L2CAP_JOIN_RX_FRAGS