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

Commit 6e65b807 authored by Zach Johnson's avatar Zach Johnson
Browse files

Remove l2cu_get_conn_role

it's basically returning a constant

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Icba32a66264a8408a5bdf6a8cd6cdc3caf20c014
parent c105be2e
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -430,8 +430,6 @@ typedef struct {
  tL2C_CCB* p_free_ccb_first; /* Pointer to first free CCB */
  tL2C_CCB* p_free_ccb_last;  /* Pointer to last  free CCB */

  uint8_t
      desire_role; /* desire to be master/slave when accepting a connection */
  bool disallow_switch;     /* false, to allow switch at create conn */
  uint16_t num_lm_acl_bufs; /* # of ACL buffers on controller */
  uint16_t idle_timeout;    /* Idle timeout */
@@ -537,7 +535,6 @@ extern tL2C_LCB* l2cu_find_lcb_by_bd_addr(const RawAddress& p_bd_addr,
                                          tBT_TRANSPORT transport);
extern tL2C_LCB* l2cu_find_lcb_by_handle(uint16_t handle);

extern uint8_t l2cu_get_conn_role(tL2C_LCB* p_this_lcb);
extern bool l2cu_set_acl_priority(const RawAddress& bd_addr, uint8_t priority,
                                  bool reset_after_rs);

+2 −2
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ void l2c_link_hci_conn_req(const RawAddress& bd_addr) {
      if (!btm_dev_support_switch(bd_addr))
        p_lcb->link_role = HCI_ROLE_SLAVE;
      else
        p_lcb->link_role = l2cu_get_conn_role(p_lcb);
        p_lcb->link_role = HCI_ROLE_MASTER;
    }

    /* Tell the other side we accept the connection */
@@ -107,7 +107,7 @@ void l2c_link_hci_conn_req(const RawAddress& bd_addr) {
    if (!btm_dev_support_switch(bd_addr))
      p_lcb->link_role = HCI_ROLE_SLAVE;
    else
      p_lcb->link_role = l2cu_get_conn_role(p_lcb);
      p_lcb->link_role = HCI_ROLE_MASTER;

    btsnd_hcic_accept_conn(bd_addr, p_lcb->link_role);

+0 −2
Original line number Diff line number Diff line
@@ -872,8 +872,6 @@ void l2c_init(void) {
  l2cb.p_free_ccb_first = &l2cb.ccb_pool[0];
  l2cb.p_free_ccb_last = &l2cb.ccb_pool[MAX_L2CAP_CHANNELS - 1];

  l2cb.desire_role = HCI_ROLE_MASTER;

  /* Set the default idle timeout */
  l2cb.idle_timeout = L2CAP_LINK_INACTIVITY_TOUT;

+0 −14
Original line number Diff line number Diff line
@@ -230,20 +230,6 @@ tL2C_LCB* l2cu_find_lcb_by_bd_addr(const RawAddress& p_bd_addr,
  return (NULL);
}

/*******************************************************************************
 *
 * Function         l2cu_get_conn_role
 *
 * Description      Determine the desired role (master or slave) of a link.
 *                  If already got a slave link, this one must be a master. If
 *                  already got at least 1 link where we are the master, make
 *                  this also a master.
 *
 * Returns          HCI_ROLE_MASTER or HCI_ROLE_SLAVE
 *
 ******************************************************************************/
uint8_t l2cu_get_conn_role(tL2C_LCB* p_this_lcb) { return l2cb.desire_role; }

/*******************************************************************************
 *
 * Function         l2c_is_cmd_rejected