OBX_FCR_OPT_MONITOR_TOUT, /* Monitor timeout (12 secs) */
OBX_FCR_OPT_MAX_PDU_SIZE /* MPS segment size */
};
-const tL2CAP_ERTM_INFO obex_l2c_etm_opt = {
- L2CAP_FCR_ERTM_MODE, /* Mandatory for OBEX over l2cap */
- OBX_USER_RX_BUF_SIZE, OBX_USER_TX_BUF_SIZE,
- OBX_FCR_RX_BUF_SIZE, OBX_FCR_TX_BUF_SIZE};
+const tL2CAP_ERTM_INFO obex_l2c_etm_opt = {L2CAP_FCR_ERTM_MODE,
+ /* Mandatory for OBEX over l2cap */};
/**
* When using a dynamic PSM, a PSM allocation is requested from
#define L2CAP_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
#endif
-/* Sends L2CAP segmented packets in ERTM mode */
-#ifndef L2CAP_FCR_TX_BUF_SIZE
-#define L2CAP_FCR_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
-#endif
-
-/* Receives L2CAP segmented packets in ERTM mode */
-#ifndef L2CAP_FCR_RX_BUF_SIZE
-#define L2CAP_FCR_RX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
-#endif
-
#ifndef L2CAP_FCR_ERTM_BUF_SIZE
#define L2CAP_FCR_ERTM_BUF_SIZE (10240 + 24)
#endif
/* Include the browsing channel which uses eFCR */
tL2CAP_ERTM_INFO ertm_info;
ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE;
- ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- ertm_info.fcr_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- ertm_info.fcr_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
L2CA_Register2(AVCT_BR_PSM, avct_l2c_br_appl, true /*enable_snoop*/,
&ertm_info, kAvrcBrMtu, AVCT_MIN_BROWSE_MTU,
/* Set the FCR options: Browsing channel mandates ERTM */
ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE;
- ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- ertm_info.fcr_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- ertm_info.fcr_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
/* call l2cap connect req */
p_bcb->ch_state = AVCT_CH_CONN;
/* Set the FCR options: Browsing channel mandates ERTM */
ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE;
- ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- ertm_info.fcr_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- ertm_info.fcr_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
/* Send L2CAP connect rsp */
L2CA_ErtmConnectRsp(bd_addr, id, lcid, result, 0, &ertm_info);
if (p_ccb->cfg.fcr_present) {
if (ertm_info == NULL) {
p_ccb->ertm_info.preferred_mode = p_ccb->cfg.fcr.mode;
- p_ccb->ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- p_ccb->ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- p_ccb->ertm_info.fcr_rx_buf_size = L2CAP_INVALID_ERM_BUF_SIZE;
- p_ccb->ertm_info.fcr_tx_buf_size = L2CAP_INVALID_ERM_BUF_SIZE;
} else {
p_ccb->ertm_info = *ertm_info;
}
/* Remember the remote MTU size */
if (p_ccb->cfg.fcr.mode == L2CAP_FCR_ERTM_MODE) {
- local_mtu_size =
- p_ccb->ertm_info.user_tx_buf_size - sizeof(BT_HDR) - L2CAP_MIN_OFFSET;
+ local_mtu_size = BT_DEFAULT_BUFFER_SIZE - sizeof(BT_HDR) - L2CAP_MIN_OFFSET;
} else
local_mtu_size = L2CAP_MTU_SIZE;
*/
typedef struct {
uint8_t preferred_mode;
- uint16_t user_rx_buf_size;
- uint16_t user_tx_buf_size;
- uint16_t fcr_rx_buf_size;
- uint16_t fcr_tx_buf_size;
} tL2CAP_ERTM_INFO;
/**
p_rcb->log_packets = enable_snoop;
p_rcb->api = p_cb_info;
p_rcb->real_psm = psm;
- p_rcb->ertm_info = p_ertm_info == nullptr ? tL2CAP_ERTM_INFO{} : *p_ertm_info;
+ p_rcb->ertm_info = p_ertm_info == nullptr
+ ? tL2CAP_ERTM_INFO{L2CAP_FCR_BASIC_MODE}
+ : *p_ertm_info;
p_rcb->my_mtu = my_mtu;
p_rcb->required_remote_mtu =
std::max<uint16_t>(required_remote_mtu, L2CAP_MIN_MTU);
if (p_ertm_info) {
p_ccb->ertm_info = *p_ertm_info;
- /* Replace default indicators with the actual default pool */
- if (p_ccb->ertm_info.fcr_rx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE)
- p_ccb->ertm_info.fcr_rx_buf_size = L2CAP_FCR_RX_BUF_SIZE;
-
- if (p_ccb->ertm_info.fcr_tx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE)
- p_ccb->ertm_info.fcr_tx_buf_size = L2CAP_FCR_TX_BUF_SIZE;
-
- if (p_ccb->ertm_info.user_rx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE)
- p_ccb->ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
-
- if (p_ccb->ertm_info.user_tx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE)
- p_ccb->ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
-
p_ccb->max_rx_mtu =
- p_ertm_info->user_rx_buf_size -
+ BT_DEFAULT_BUFFER_SIZE -
(L2CAP_MIN_OFFSET + L2CAP_SDU_LEN_OFFSET + L2CAP_FCS_LEN);
}
if (p_ertm_info) {
p_ccb->ertm_info = *p_ertm_info;
- /* Replace default indicators with the actual default pool */
- if (p_ccb->ertm_info.fcr_rx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE)
- p_ccb->ertm_info.fcr_rx_buf_size = L2CAP_FCR_RX_BUF_SIZE;
-
- if (p_ccb->ertm_info.fcr_tx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE)
- p_ccb->ertm_info.fcr_tx_buf_size = L2CAP_FCR_TX_BUF_SIZE;
-
- if (p_ccb->ertm_info.user_rx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE)
- p_ccb->ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
-
- if (p_ccb->ertm_info.user_tx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE)
- p_ccb->ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
-
p_ccb->max_rx_mtu =
- p_ertm_info->user_rx_buf_size -
+ BT_DEFAULT_BUFFER_SIZE -
(L2CAP_MIN_OFFSET + L2CAP_SDU_LEN_OFFSET + L2CAP_FCS_LEN);
}
if ((tx_seq == next_srej) &&
(fixed_queue_length(p_fcrb->srej_rcv_hold_q) <
p_ccb->our_cfg.fcr.tx_win_sz)) {
- /* If user gave us a pool for held rx buffers, use that */
- /* TODO: Could that happen? Get rid of this code. */
- if (p_ccb->ertm_info.fcr_rx_buf_size != L2CAP_FCR_RX_BUF_SIZE) {
- BT_HDR* p_buf2;
-
- /* Adjust offset and len so that control word is copied */
- p_buf->offset -= L2CAP_FCR_OVERHEAD;
- p_buf->len += L2CAP_FCR_OVERHEAD;
-
- p_buf2 = l2c_fcr_clone_buf(p_buf, p_buf->offset, p_buf->len);
-
- if (p_buf2) {
- osi_free(p_buf);
- p_buf = p_buf2;
- }
- p_buf->offset += L2CAP_FCR_OVERHEAD;
- p_buf->len -= L2CAP_FCR_OVERHEAD;
- }
L2CAP_TRACE_DEBUG(
"process_i_frame() Lost: %u tx_seq:%u ExpTxSeq %u Rej: %u "
"SRej1",
p_ccb->peer_cfg.fcs = p_cfg->fcs;
}
- max_retrans_size = p_ccb->ertm_info.fcr_tx_buf_size - sizeof(BT_HDR) -
+ max_retrans_size = BT_DEFAULT_BUFFER_SIZE - sizeof(BT_HDR) -
L2CAP_MIN_OFFSET - L2CAP_SDU_LEN_OFFSET -
L2CAP_FCS_LEN;
p_ccb->ertm_info.preferred_mode =
L2CAP_FCR_BASIC_MODE; /* Default mode for channel is basic mode */
- p_ccb->ertm_info.fcr_rx_buf_size = L2CAP_FCR_RX_BUF_SIZE;
- p_ccb->ertm_info.fcr_tx_buf_size = L2CAP_FCR_TX_BUF_SIZE;
- p_ccb->ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
- p_ccb->ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
p_ccb->max_rx_mtu = L2CAP_MTU_SIZE;
- p_ccb->tx_mps = L2CAP_FCR_TX_BUF_SIZE - 32;
+ p_ccb->tx_mps = BT_DEFAULT_BUFFER_SIZE - 32;
p_ccb->xmit_hold_q = fixed_queue_new(SIZE_MAX);
p_ccb->fcrb.srej_rcv_hold_q = fixed_queue_new(SIZE_MAX);