Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7bd827c authored by Zach Johnson's avatar Zach Johnson Committed by Chris Manton
Browse files

l2c_link_processs_num_bufs -> l2c_link_init

have link fetch its own values from the controller

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I13eef873faffa0acb0596e6a7de49da6f0796d0d
parent 45103187
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ static void reset_complete(void* result) {

  btm_pm_reset();

  l2c_link_processs_num_bufs(controller->get_acl_buffer_count_classic());
  l2c_link_init();

  // setup the random number generator
  std::srand(std::time(nullptr));
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@

extern void l2cu_set_non_flushable_pbf(bool is_supported);

extern void l2c_link_processs_num_bufs(uint16_t num_lm_acl_bufs);
extern void l2c_link_init();

extern void l2c_link_processs_ble_num_bufs(uint16_t num_lm_acl_bufs);

+5 −14
Original line number Diff line number Diff line
@@ -748,20 +748,11 @@ void l2c_link_adjust_chnl_allocation(void) {
  }
}

/*******************************************************************************
 *
 * Function         l2c_link_processs_num_bufs
 *
 * Description      This function is called when a "controller buffer size"
 *                  event is first received from the controller. It updates
 *                  the L2CAP values.
 *
 * Returns          void
 *
 ******************************************************************************/
void l2c_link_processs_num_bufs(uint16_t num_lm_acl_bufs) {
  l2cb.num_lm_acl_bufs = num_lm_acl_bufs;
  l2cb.controller_xmit_window = num_lm_acl_bufs;
void l2c_link_init() {
  const controller_t* controller = controller_get_interface();

  l2cb.num_lm_acl_bufs = controller->get_acl_buffer_count_classic();
  l2cb.controller_xmit_window = controller->get_acl_buffer_count_classic();
}

/*******************************************************************************