From: Hansong Zhang Date: Wed, 30 Sep 2020 23:30:40 +0000 (-0700) Subject: L2cap: clean up flush timeout option X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d38a1018c7;p=android-x86%2Fsystem-bt.git 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 --- diff --git a/bta/av/bta_av_aact.cc b/bta/av/bta_av_aact.cc index c64038985..9fe09ef49 100644 --- a/bta/av/bta_av_aact.cc +++ b/bta/av/bta_av_aact.cc @@ -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); } { diff --git a/stack/include/avdt_api.h b/stack/include/avdt_api.h index b069bf8a8..52289f692 100644 --- a/stack/include/avdt_api.h +++ b/stack/include/avdt_api.h @@ -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 diff --git a/stack/include/l2cdefs.h b/stack/include/l2cdefs.h index 14a55fcba..ad3512d9a 100644 --- a/stack/include/l2cdefs.h +++ b/stack/include/l2cdefs.h @@ -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 diff --git a/stack/l2cap/l2c_api.cc b/stack/l2cap/l2c_api.cc index 5e92ce901..5fbc9eb14 100644 --- a/stack/l2cap/l2c_api.cc +++ b/stack/l2cap/l2c_api.cc @@ -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) { diff --git a/stack/l2cap/l2c_utils.cc b/stack/l2cap/l2c_utils.cc index af2ff03ef..a94fabca5 100644 --- a/stack/l2cap/l2c_utils.cc +++ b/stack/l2cap/l2c_utils.cc @@ -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;