OSDN Git Service

BNEP_MIN_MTU_SIZE is the same as BNEP_MTU_SIZE
authorHansong Zhang <hsz@google.com>
Thu, 24 Sep 2020 02:17:21 +0000 (19:17 -0700)
committerHansong Zhang <hsz@google.com>
Thu, 24 Sep 2020 02:17:21 +0000 (19:17 -0700)
Just use one const.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ib7239f21ea4f3270268d0c206b695150097cff7f

internal_include/bt_target.h
stack/bnep/bnep_main.cc

index 4da7f2d..bf04fbd 100644 (file)
 #define BNEP_MAX_MULTI_FILTERS 5
 #endif
 
-/* Minimum MTU size. */
-#ifndef BNEP_MIN_MTU_SIZE
-#define BNEP_MIN_MTU_SIZE L2CAP_MTU_SIZE
-#endif
-
 /* Preferred MTU size. */
 #ifndef BNEP_MTU_SIZE
-#define BNEP_MTU_SIZE BNEP_MIN_MTU_SIZE
+#define BNEP_MTU_SIZE L2CAP_MTU_SIZE
 #endif
 
 /* Maximum number of buffers allowed in transmit data queue. */
index 28118b4..8093794 100644 (file)
@@ -220,11 +220,11 @@ static void bnep_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) {
   BNEP_TRACE_EVENT("BNEP - Rcvd cfg ind, CID: 0x%x", l2cap_cid);
 
   /* Remember the remote MTU size */
-  if ((!p_cfg->mtu_present) || (p_cfg->mtu < BNEP_MIN_MTU_SIZE)) {
+  if ((!p_cfg->mtu_present) || (p_cfg->mtu < BNEP_MTU_SIZE)) {
     mtu = p_cfg->mtu;
     p_cfg->flush_to_present = false;
     p_cfg->mtu_present = true;
-    p_cfg->mtu = BNEP_MIN_MTU_SIZE;
+    p_cfg->mtu = BNEP_MTU_SIZE;
     p_cfg->result = result = L2CAP_CFG_UNACCEPTABLE_PARAMS;
   } else {
     if (p_cfg->mtu > BNEP_MTU_SIZE)