OSDN Git Service

We can't bypass FCS
authorHansong Zhang <hsz@google.com>
Thu, 24 Sep 2020 03:40:13 +0000 (20:40 -0700)
committerHansong Zhang <hsz@google.com>
Thu, 24 Sep 2020 22:35:05 +0000 (15:35 -0700)
Note that in the case where the peer doesn't support FCS, we still send
FCS. This is an existing behavior and we keep it the same for now.

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

stack/l2cap/l2c_fcr.cc
stack/l2cap/l2c_int.h
stack/l2cap/l2c_utils.cc

index 3256214..b0dcb4e 100644 (file)
@@ -1971,8 +1971,6 @@ uint8_t l2c_fcr_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
       if (p_cfg->fcs_present) {
         p_ccb->peer_cfg.fcs = p_cfg->fcs;
         p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_FCS;
-        if (p_cfg->fcs == L2CAP_CFG_FCS_BYPASS)
-          p_ccb->bypass_fcs |= L2CAP_CFG_FCS_PEER;
       }
 
       max_retrans_size = p_ccb->ertm_info.fcr_tx_buf_size - sizeof(BT_HDR) -
index b2717c4..cd5f2d9 100644 (file)
@@ -282,11 +282,6 @@ typedef struct t_l2c_ccb {
   bool out_cfg_fcr_present; /* true if cfg response shoulkd include fcr options
                                */
 
-#define L2CAP_CFG_FCS_OUR 0x01  /* Our desired config FCS option */
-#define L2CAP_CFG_FCS_PEER 0x02 /* Peer's desired config FCS option */
-#define L2CAP_BYPASS_FCS (L2CAP_CFG_FCS_OUR | L2CAP_CFG_FCS_PEER)
-  uint8_t bypass_fcs;
-
   bool is_flushable; /* true if channel is flushable */
 
   uint16_t fixed_chnl_idle_tout; /* Idle timeout to use for the fixed channel */
index 38013da..8e4f31e 100644 (file)
@@ -1358,7 +1358,6 @@ tL2C_CCB* l2cu_allocate_ccb(tL2C_LCB* p_lcb, uint16_t cid) {
   p_ccb->our_cfg.qos.delay_variation = p_ccb->peer_cfg.qos.delay_variation =
       L2CAP_DEFAULT_DELAY;
 
-  p_ccb->bypass_fcs = 0;
   memset(&p_ccb->ertm_info, 0, sizeof(tL2CAP_ERTM_INFO));
   p_ccb->peer_cfg_already_rejected = false;
   p_ccb->fcr_cfg_tries = L2CAP_MAX_FCR_CFG_TRIES;