OSDN Git Service

L2CAP: peer_cfg_bits is unused
authorHansong Zhang <hsz@google.com>
Fri, 25 Sep 2020 02:28:17 +0000 (19:28 -0700)
committerHansong Zhang <hsz@google.com>
Fri, 25 Sep 2020 17:07:39 +0000 (10:07 -0700)
Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Icec4e536f28a649779f747d34a7d76295f5ef10f

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

index 1a75312..5051b93 100644 (file)
@@ -159,15 +159,6 @@ struct tL2CAP_LE_CFG_INFO {
   uint16_t credits = L2CAP_LE_CREDIT_DEFAULT;
 };
 
-/* L2CAP channel configured field bitmap */
-#define L2CAP_CH_CFG_MASK_MTU 0x0001
-#define L2CAP_CH_CFG_MASK_QOS 0x0002
-#define L2CAP_CH_CFG_MASK_FLUSH_TO 0x0004
-#define L2CAP_CH_CFG_MASK_FCR 0x0008
-#define L2CAP_CH_CFG_MASK_FCS 0x0010
-
-typedef uint16_t tL2CAP_CH_CFG_BITS;
-
 /*********************************
  *  Callback Functions Prototypes
  *********************************/
index b0dcb4e..9ef4b3b 100644 (file)
@@ -1970,7 +1970,6 @@ uint8_t l2c_fcr_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
       /* Peer desires to bypass FCS check, and streaming or ERTM mode */
       if (p_cfg->fcs_present) {
         p_ccb->peer_cfg.fcs = p_cfg->fcs;
-        p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_FCS;
       }
 
       max_retrans_size = p_ccb->ertm_info.fcr_tx_buf_size - sizeof(BT_HDR) -
@@ -2001,7 +2000,6 @@ uint8_t l2c_fcr_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
     /* Everything ok, so save the peer's adjusted fcr options */
     p_ccb->peer_cfg.fcr = p_cfg->fcr;
 
-    if (p_cfg->fcr_present) p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_FCR;
   } else if (fcr_ok == L2CAP_PEER_CFG_UNACCEPTABLE) {
     /* Allow peer only one retry for mode */
     if (p_ccb->peer_cfg_already_rejected)
index bcf1c23..057113f 100644 (file)
@@ -262,7 +262,6 @@ typedef struct t_l2c_ccb {
   uint8_t flags;
 
   tL2CAP_CFG_INFO our_cfg;          /* Our saved configuration options */
-  tL2CAP_CH_CFG_BITS peer_cfg_bits; /* Store what peer wants to configure */
   tL2CAP_CFG_INFO peer_cfg;         /* Peer's saved configuration options */
 
   fixed_queue_t* xmit_hold_q; /* Transmit data hold queue */
index 8e4f31e..3d64cc6 100644 (file)
@@ -1335,9 +1335,6 @@ tL2C_CCB* l2cu_allocate_ccb(tL2C_LCB* p_lcb, uint16_t cid) {
 
   if (p_lcb) l2cu_enqueue_ccb(p_ccb);
 
-  /* clear what peer wants to configure */
-  p_ccb->peer_cfg_bits = 0;
-
   /* Put in default values for configuration */
   memset(&p_ccb->our_cfg, 0, sizeof(tL2CAP_CFG_INFO));
   memset(&p_ccb->peer_cfg, 0, sizeof(tL2CAP_CFG_INFO));
@@ -1770,7 +1767,6 @@ uint8_t l2cu_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
       /* Save the accepted value in case of renegotiation */
       p_ccb->peer_cfg.mtu = p_cfg->mtu;
       p_ccb->peer_cfg.mtu_present = true;
-      p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_MTU;
     } else /* Illegal MTU value */
     {
       p_cfg->mtu = L2CAP_MIN_MTU;
@@ -1792,7 +1788,6 @@ uint8_t l2cu_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
     {
       p_ccb->peer_cfg.flush_to_present = true;
       p_ccb->peer_cfg.flush_to = p_cfg->flush_to;
-      p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_FLUSH_TO;
     }
   }
   /* Reload flush_to from a previously accepted config request */
@@ -1809,7 +1804,6 @@ uint8_t l2cu_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
     if (p_cfg->qos.service_type <= SVC_TYPE_GUARANTEED) {
       p_ccb->peer_cfg.qos = p_cfg->qos;
       p_ccb->peer_cfg.qos_present = true;
-      p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_QOS;
     } else /* Illegal service type value */
     {
       p_cfg->qos.service_type = SVC_TYPE_BEST_EFFORT;