OSDN Git Service

Precisely name tL2C_CB::num_used_lcbs
authorChris Manton <cmanton@google.com>
Fri, 21 Aug 2020 04:56:23 +0000 (21:56 -0700)
committerChris Manton <cmanton@google.com>
Fri, 21 Aug 2020 15:58:24 +0000 (08:58 -0700)
From: tL2C_CB::tL2C_LCB::num_links_active

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I053469981e035493bc37de98fb44123622618859

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

index 507cc81..19ee26e 100644 (file)
@@ -447,7 +447,7 @@ typedef struct {
   alarm_t* receive_hold_timer; /* Timer entry for rcv hold */
 
   tL2C_LCB* p_cur_hcit_lcb;  /* Current HCI Transport buffer */
-  uint16_t num_links_active; /* Number of links active */
+  uint16_t num_used_lcbs;    /* Number of active link control blocks */
 
   uint16_t non_flushable_pbf; /* L2CAP_PKT_START_NON_FLUSHABLE if controller
                                  supports */
index babfd7c..d7336a8 100644 (file)
@@ -599,7 +599,7 @@ void l2c_link_adjust_allocation(void) {
       (l2cb.num_lm_ble_bufs == L2C_DEF_NUM_BLE_BUF_SHARED) ? true : false;
 
   /* If no links active, reset buffer quotas and controller buffers */
-  if (l2cb.num_links_active == 0) {
+  if (l2cb.num_used_lcbs == 0) {
     l2cb.controller_xmit_window = l2cb.num_lm_acl_bufs;
     l2cb.round_robin_quota = l2cb.round_robin_unacked = 0;
     return;
index f18375a..50061ba 100644 (file)
@@ -85,7 +85,7 @@ tL2C_LCB* l2cu_allocate_lcb(const RawAddress& p_bd_addr, bool is_bonding,
         l2cb.num_ble_links_active++;
         l2c_ble_link_adjust_allocation();
       } else {
-        l2cb.num_links_active++;
+        l2cb.num_used_lcbs++;
         l2c_link_adjust_allocation();
       }
       p_lcb->link_xmit_data_q = list_new(NULL);
@@ -193,7 +193,7 @@ void l2cu_release_lcb(tL2C_LCB* p_lcb) {
 
     l2c_ble_link_adjust_allocation();
   } else {
-    if (l2cb.num_links_active >= 1) l2cb.num_links_active--;
+    if (l2cb.num_used_lcbs >= 1) l2cb.num_used_lcbs--;
 
     l2c_link_adjust_allocation();
   }