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

Commit 4e1d592d authored by Hansong Zhang's avatar Hansong Zhang
Browse files

L2cap: clean up flush timeout option

Seems that only one value is used.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6da78ec6108cb34316199fb16b52bacee6bf74a1
parent 3b266869
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1882,7 +1882,7 @@ void bta_av_str_stopped(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
    p_scb->co_started = false;

    p_scb->p_cos->stop(p_scb->hndl, p_scb->PeerAddress());
    L2CA_SetFlushTimeout(p_scb->PeerAddress(), L2CAP_DEFAULT_FLUSH_TO);
    L2CA_SetFlushTimeout(p_scb->PeerAddress(), L2CAP_NO_AUTOMATIC_FLUSH);
  }

  /* if q_info.a2dp_list is not empty, drop it now */
@@ -2513,7 +2513,7 @@ void bta_av_suspend_cfm(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
      p_scb->co_started = false;
      p_scb->p_cos->stop(p_scb->hndl, p_scb->PeerAddress());
    }
    L2CA_SetFlushTimeout(p_scb->PeerAddress(), L2CAP_DEFAULT_FLUSH_TO);
    L2CA_SetFlushTimeout(p_scb->PeerAddress(), L2CAP_NO_AUTOMATIC_FLUSH);
  }

  {
+0 −3
Original line number Diff line number Diff line
@@ -477,7 +477,6 @@ class AvdtpStreamConfig {
        p_sink_data_cback(nullptr),
        p_report_cback(nullptr),
        mtu(0),
        flush_to(0),
        tsep(0),
        media_type(0),
        nsc_mask(0) {}
@@ -489,7 +488,6 @@ class AvdtpStreamConfig {
    p_sink_data_cback = nullptr;
    p_report_cback = nullptr;
    mtu = 0;
    flush_to = 0;
    tsep = 0;
    media_type = 0;
    nsc_mask = 0;
@@ -501,7 +499,6 @@ class AvdtpStreamConfig {
  tAVDT_SINK_DATA_CBACK* p_sink_data_cback;  // Sink data callback function
  tAVDT_REPORT_CBACK* p_report_cback;        // Report callback function
  uint16_t mtu;        // The L2CAP MTU of the transport channel
  uint16_t flush_to;   // The L2CAP flush timeout of the transport channel
  uint8_t tsep;        // SEP type
  uint8_t media_type;  // Media type: AVDT_MEDIA_TYPE_*
  uint16_t nsc_mask;   // Nonsupported protocol command messages
+0 −2
Original line number Diff line number Diff line
@@ -192,10 +192,8 @@ static_assert(L2CAP_CONN_OTHER_ERROR != L2CAP_CFG_FAILED_NO_REASON,
/* Default values for configuration
*/
#define L2CAP_NO_AUTOMATIC_FLUSH 0xFFFF
#define L2CAP_NO_RETRANSMISSION 0x0001

#define L2CAP_DEFAULT_MTU (672)
#define L2CAP_DEFAULT_FLUSH_TO L2CAP_NO_AUTOMATIC_FLUSH
#define L2CAP_DEFAULT_SERV_TYPE 1
#define L2CAP_DEFAULT_TOKEN_RATE 0
#define L2CAP_DEFAULT_BUCKET_SIZE 0
+0 −9
Original line number Diff line number Diff line
@@ -915,15 +915,6 @@ bool L2CA_SetFlushTimeout(const RawAddress& bd_addr,
  if (flush_timeout_in_ms == 0x0000 ||
      flush_timeout_in_ms == L2CAP_NO_AUTOMATIC_FLUSH) {
    flush_timeout_in_slots = 0x0;
  } else if (flush_timeout_in_ms == L2CAP_NO_RETRANSMISSION) {
    /* no retransmission */
    /* not mandatory range for controller */
    /* Packet is flushed before getting any ACK/NACK */
    /* To do this, flush timeout should be 1 baseband slot */
    flush_timeout_in_slots = 0x0001;
  } else {
    flush_timeout_in_slots =
        ConvertMillisecondsToBasebandSlots(flush_timeout_in_ms);
  }

  if (RawAddress::kAny != bd_addr) {
+1 −1
Original line number Diff line number Diff line
@@ -1339,7 +1339,7 @@ tL2C_CCB* l2cu_allocate_ccb(tL2C_LCB* p_lcb, uint16_t cid) {
  memset(&p_ccb->peer_cfg, 0, sizeof(tL2CAP_CFG_INFO));

  /* Put in default values for local/peer configurations */
  p_ccb->our_cfg.flush_to = p_ccb->peer_cfg.flush_to = L2CAP_DEFAULT_FLUSH_TO;
  p_ccb->our_cfg.flush_to = p_ccb->peer_cfg.flush_to = L2CAP_NO_AUTOMATIC_FLUSH;
  p_ccb->our_cfg.mtu = p_ccb->peer_cfg.mtu = L2CAP_DEFAULT_MTU;
  p_ccb->our_cfg.qos.service_type = p_ccb->peer_cfg.qos.service_type =
      L2CAP_DEFAULT_SERV_TYPE;