Lines Matching full:mtu

537 	req->mtu = sys_cpu_to_le16(ch->rx.mtu);  in l2cap_le_conn_req()
577 req->mtu = sys_cpu_to_le16(ch->rx.mtu); in l2cap_ecred_conn_req()
581 req_mtu = ch->tx.mtu; in l2cap_ecred_conn_req()
588 __ASSERT(ch->tx.mtu == req_mtu, in l2cap_ecred_conn_req()
589 "The MTU shall be the same for channels in the same request."); in l2cap_ecred_conn_req()
1221 /* Use existing MTU if defined */ in l2cap_chan_rx_init()
1222 if (!chan->rx.mtu) { in l2cap_chan_rx_init()
1223 /* If application has not provide the incoming L2CAP SDU MTU use in l2cap_chan_rx_init()
1224 * an MTU that does not require segmentation. in l2cap_chan_rx_init()
1226 chan->rx.mtu = BT_L2CAP_SDU_RX_MTU; in l2cap_chan_rx_init()
1229 /* MPS shall not be bigger than MTU + BT_L2CAP_SDU_HDR_SIZE as the in l2cap_chan_rx_init()
1232 chan->rx.mps = MIN(chan->rx.mtu + BT_L2CAP_SDU_HDR_SIZE, in l2cap_chan_rx_init()
1235 /* Truncate MTU if channel have disabled segmentation but still have in l2cap_chan_rx_init()
1236 * set an MTU which requires it. in l2cap_chan_rx_init()
1239 (chan->rx.mps < chan->rx.mtu + BT_L2CAP_SDU_HDR_SIZE)) { in l2cap_chan_rx_init()
1240 LOG_WRN("Segmentation disabled but MTU > MPS, truncating MTU"); in l2cap_chan_rx_init()
1241 chan->rx.mtu = chan->rx.mps - BT_L2CAP_SDU_HDR_SIZE; in l2cap_chan_rx_init()
1347 uint16_t mtu, uint16_t mps, uint16_t credits, in l2cap_chan_accept() argument
1396 le_chan->tx.mtu = mtu; in l2cap_chan_accept()
1447 uint16_t psm, scid, mtu, mps, credits; in le_conn_req() local
1457 mtu = sys_le16_to_cpu(req->mtu); in le_conn_req()
1461 LOG_DBG("psm 0x%02x scid 0x%04x mtu %u mps %u credits %u", psm, scid, mtu, mps, credits); in le_conn_req()
1463 if (mtu < L2CAP_LE_MIN_MTU || mps < L2CAP_LE_MIN_MTU) { in le_conn_req()
1464 LOG_ERR("Invalid LE-Conn Req params: mtu %u mps %u", mtu, mps); in le_conn_req()
1490 result = l2cap_chan_accept(conn, server, scid, mtu, mps, credits, in le_conn_req()
1501 rsp->mtu = sys_cpu_to_le16(le_chan->rx.mtu); in le_conn_req()
1529 uint16_t mtu, mps, credits, result = BT_L2CAP_LE_SUCCESS; in le_ecred_conn_req() local
1556 mtu = sys_le16_to_cpu(req->mtu); in le_ecred_conn_req()
1560 LOG_DBG("psm 0x%02x mtu %u mps %u credits %u", psm, mtu, mps, credits); in le_ecred_conn_req()
1562 if (mtu < BT_L2CAP_ECRED_MIN_MTU || mps < BT_L2CAP_ECRED_MIN_MTU) { in le_ecred_conn_req()
1563 LOG_ERR("Invalid ecred conn req params. mtu %u mps %u", mtu, mps); in le_ecred_conn_req()
1585 rc = l2cap_chan_accept(conn, server, scid, mtu, mps, in le_ecred_conn_req()
1621 rsp->mtu = sys_cpu_to_le16(ch->rx.mtu); in le_ecred_conn_req()
1655 uint16_t mtu, mps; in le_ecred_reconf_req() local
1667 mtu = sys_le16_to_cpu(req->mtu); in le_ecred_reconf_req()
1675 if (mtu < BT_L2CAP_ECRED_MIN_MTU) { in le_ecred_reconf_req()
1695 if (BT_L2CAP_LE_CHAN(chan)->tx.mtu > mtu) { in le_ecred_reconf_req()
1696 LOG_ERR("chan %p decreased MTU %u -> %u", chan, in le_ecred_reconf_req()
1697 BT_L2CAP_LE_CHAN(chan)->tx.mtu, mtu); in le_ecred_reconf_req()
1720 BT_L2CAP_LE_CHAN(chans[i])->tx.mtu = mtu; in le_ecred_reconf_req()
1728 LOG_DBG("mtu %u mps %u", mtu, mps); in le_ecred_reconf_req()
1767 ch->rx.mtu = ch->pending_rx_mtu; in le_ecred_reconf_rsp()
1899 uint16_t dcid, mtu, mps, credits, result, psm; in le_ecred_conn_rsp() local
1909 mtu = sys_le16_to_cpu(rsp->mtu); in le_ecred_conn_rsp()
1914 LOG_DBG("mtu 0x%04x mps 0x%04x credits 0x%04x result %u", mtu, mps, credits, result); in le_ecred_conn_rsp()
1992 chan->tx.mtu = mtu; in le_ecred_conn_rsp()
2029 uint16_t dcid, mtu, mps, credits, result; in le_conn_rsp() local
2037 mtu = sys_le16_to_cpu(rsp->mtu); in le_conn_rsp()
2042 LOG_DBG("dcid 0x%04x mtu %u mps %u credits %u result 0x%04x", dcid, mtu, mps, credits, in le_conn_rsp()
2068 chan->tx.mtu = mtu; in le_conn_rsp()
2546 if (chan->_sdu_len > chan->rx.mtu) { in l2cap_chan_le_recv_seg_direct()
2547 LOG_WRN("SDU exceeds MTU"); in l2cap_chan_le_recv_seg_direct()
2613 if (sdu_len > chan->rx.mtu) { in l2cap_chan_le_recv()
2897 LOG_DBG("ch %p psm 0x%02x mtu %u mps %u credits 1", ch, ch->psm, ch->rx.mtu, ch->rx.mps); in l2cap_ecred_init()
2953 int bt_l2cap_ecred_chan_reconfigure(struct bt_l2cap_chan **chans, uint16_t mtu) in bt_l2cap_ecred_chan_reconfigure() argument
2962 LOG_DBG("chans %p mtu 0x%04x", chans, mtu); in bt_l2cap_ecred_chan_reconfigure()
2982 /* validate MTU is not decreased */ in bt_l2cap_ecred_chan_reconfigure()
2983 if (mtu < BT_L2CAP_LE_CHAN(chans[i])->rx.mtu) { in bt_l2cap_ecred_chan_reconfigure()
3015 req->mtu = sys_cpu_to_le16(mtu); in bt_l2cap_ecred_chan_reconfigure()
3017 /* MPS shall not be bigger than MTU + BT_L2CAP_SDU_HDR_SIZE in bt_l2cap_ecred_chan_reconfigure()
3020 req->mps = sys_cpu_to_le16(MIN(mtu + BT_L2CAP_SDU_HDR_SIZE, in bt_l2cap_ecred_chan_reconfigure()
3027 ch->pending_rx_mtu = mtu; in bt_l2cap_ecred_chan_reconfigure()
3043 uint16_t mtu, uint16_t mps) in bt_l2cap_ecred_chan_reconfigure_explicit() argument
3050 LOG_DBG("chans %p chan_count %u mtu 0x%04x mps 0x%04x", chans, chan_count, mtu, mps); in bt_l2cap_ecred_chan_reconfigure_explicit()
3070 /* validate MTU is not decreased */ in bt_l2cap_ecred_chan_reconfigure_explicit()
3071 if (mtu < BT_L2CAP_LE_CHAN(chans[i])->rx.mtu) { in bt_l2cap_ecred_chan_reconfigure_explicit()
3105 req->mtu = sys_cpu_to_le16(mtu); in bt_l2cap_ecred_chan_reconfigure_explicit()
3114 ch->pending_rx_mtu = mtu; in bt_l2cap_ecred_chan_reconfigure_explicit()
3221 if (sdu_len > le_chan->tx.mtu) { in bt_l2cap_dyn_chan_send()
3222 LOG_ERR("attempt to send %u bytes on %u MTU chan", in bt_l2cap_dyn_chan_send()
3223 sdu_len, le_chan->tx.mtu); in bt_l2cap_dyn_chan_send()