From efac17d339cc6e11a6fc54f61f9b823c9d776fb5 Mon Sep 17 00:00:00 2001 From: David Marble Date: Mon, 1 Apr 2024 13:04:54 -0500 Subject: [PATCH] Realtek/rtkbt: remove ACL over HCI support. It was removed by Google in QPR2. SCO over HCI support was also removed by Google but had already been disabled by realtek. Remove more remnants of SCO over HCI. Change-Id: I69bc859a6ebfa65287cb20968eb82e2e133f200c --- .../libbt-vendor/include/rtk_btsnoop_net.h | 2 +- rtkbt/code/libbt-vendor/src/hci_h5.c | 10 ----- rtkbt/code/libbt-vendor/src/rtk_btsnoop_net.c | 10 +---- rtkbt/code/libbt-vendor/src/userial_vendor.c | 40 ++----------------- 4 files changed, 6 insertions(+), 56 deletions(-) diff --git a/rtkbt/code/libbt-vendor/include/rtk_btsnoop_net.h b/rtkbt/code/libbt-vendor/include/rtk_btsnoop_net.h index 8fa21d4..1bb6a42 100755 --- a/rtkbt/code/libbt-vendor/include/rtk_btsnoop_net.h +++ b/rtkbt/code/libbt-vendor/include/rtk_btsnoop_net.h @@ -49,7 +49,7 @@ void rtk_btsnoop_open(void); void rtk_btsnoop_close(void); -void rtk_btsnoop_capture(const HC_BT_HDR *p_buf, bool is_rcvd); +void rtk_btsnoop_capture(const HC_BT_HDR *p_buf); void rtk_btsnoop_net_open(); void rtk_btsnoop_net_close(); diff --git a/rtkbt/code/libbt-vendor/src/hci_h5.c b/rtkbt/code/libbt-vendor/src/hci_h5.c index fc59163..d838edc 100755 --- a/rtkbt/code/libbt-vendor/src/hci_h5.c +++ b/rtkbt/code/libbt-vendor/src/hci_h5.c @@ -1501,20 +1501,10 @@ static uint8_t h5_complete_rx_pkt(tHCI_H5_CB *h5) //H5LogMsg("h5_complete_rx_pkt, pkt_type = %d", pkt_type); switch (pkt_type) { - case HCI_ACLDATA_PKT: - pass_up = 1; - eventtype = MSG_HC_TO_STACK_HCI_ACL; - break; - case HCI_EVENT_PKT: pass_up = 1; eventtype = MSG_HC_TO_STACK_HCI_EVT; break; - - case HCI_SCODATA_PKT: - pass_up = 1; - eventtype = MSG_HC_TO_STACK_HCI_SCO; - break; case HCI_COMMAND_PKT: pass_up = 1; eventtype = MSG_HC_TO_STACK_HCI_ERR; diff --git a/rtkbt/code/libbt-vendor/src/rtk_btsnoop_net.c b/rtkbt/code/libbt-vendor/src/rtk_btsnoop_net.c index 27edcd7..0dea18a 100755 --- a/rtkbt/code/libbt-vendor/src/rtk_btsnoop_net.c +++ b/rtkbt/code/libbt-vendor/src/rtk_btsnoop_net.c @@ -180,7 +180,7 @@ static void rtk_btsnoop_write_packet(serial_data_type_t type, const uint8_t *pac pthread_mutex_unlock(&btsnoop_log_lock); } -void rtk_btsnoop_capture(const HC_BT_HDR *p_buf, bool is_rcvd) { +void rtk_btsnoop_capture(const HC_BT_HDR *p_buf) { const uint8_t *p = (const uint8_t *)(p_buf + 1) + p_buf->offset; if (hci_btsnoop_fd == -1) @@ -192,14 +192,6 @@ void rtk_btsnoop_capture(const HC_BT_HDR *p_buf, bool is_rcvd) { else rtk_btsnoop_write_packet(HCI_EVENT_PKT, p, false); break; - case MSG_HC_TO_STACK_HCI_ACL: - case MSG_STACK_TO_HC_HCI_ACL: - rtk_btsnoop_write_packet(HCI_ACLDATA_PKT, p, is_rcvd); - break; - case MSG_HC_TO_STACK_HCI_SCO: - case MSG_STACK_TO_HC_HCI_SCO: - rtk_btsnoop_write_packet(HCI_SCODATA_PKT, p, is_rcvd); - break; case MSG_STACK_TO_HC_HCI_CMD: if(((rtkbt_h5logfilter & 1) == 0) || (*p != 0x94) || (*(p + 1) != 0xfc)) rtk_btsnoop_write_packet(HCI_COMMAND_PKT, p, true); diff --git a/rtkbt/code/libbt-vendor/src/userial_vendor.c b/rtkbt/code/libbt-vendor/src/userial_vendor.c index 16cbe99..a801aab 100755 --- a/rtkbt/code/libbt-vendor/src/userial_vendor.c +++ b/rtkbt/code/libbt-vendor/src/userial_vendor.c @@ -855,8 +855,7 @@ static int userial_coex_recv_data_handler(unsigned char * recv_buffer, int total unsigned char * p_data = recv_buffer; int length = total_length; HC_BT_HDR * p_buf; - uint8_t boundary_flag; - uint16_t len, handle, acl_length, l2cap_length; + uint16_t len; switch (coex_packet_recv_state) { case RTKBT_PACKET_IDLE: coex_packet_bytes_need = 1; @@ -952,26 +951,11 @@ static int userial_coex_recv_data_handler(unsigned char * recv_buffer, int total if(rtk_parse_manager) rtk_parse_manager->rtk_parse_internal_event_intercept(coex_resvered_buffer); break; - - case DATA_TYPE_ACL: - p_buf->event = MSG_HC_TO_STACK_HCI_ACL; - handle = *(uint16_t *)coex_resvered_buffer; - acl_length = *(uint16_t *)&coex_resvered_buffer[2]; - l2cap_length = *(uint16_t *)&coex_resvered_buffer[4]; - boundary_flag = RTK_GET_BOUNDARY_FLAG(handle); - if(rtk_parse_manager) - rtk_parse_manager->rtk_parse_l2cap_data(coex_resvered_buffer, 0); - break; - - case DATA_TYPE_SCO: - p_buf->event = MSG_HC_TO_STACK_HCI_SCO; - break; - default: p_buf->event = MSG_HC_TO_STACK_HCI_ERR; break; } - rtk_btsnoop_capture(p_buf, true); + rtk_btsnoop_capture(p_buf); } break; @@ -994,8 +978,7 @@ static void userial_coex_send_data_handler(unsigned char * send_buffer, int tota type = send_buffer[0]; int length = total_length; HC_BT_HDR * p_buf; - uint8_t boundary_flag; - uint16_t len, handle, acl_length, l2cap_length; + uint16_t len; len = BT_HC_HDR_SIZE + (length - 1); uint8_t packet[len]; @@ -1011,27 +994,12 @@ static void userial_coex_send_data_handler(unsigned char * send_buffer, int tota if(rtk_parse_manager) rtk_parse_manager->rtk_parse_command(&send_buffer[1]); break; - - case DATA_TYPE_ACL: - p_buf->event = MSG_STACK_TO_HC_HCI_ACL; - handle = *(uint16_t *)&send_buffer[1]; - acl_length = *(uint16_t *)&send_buffer[3]; - l2cap_length = *(uint16_t *)&send_buffer[5]; - boundary_flag = RTK_GET_BOUNDARY_FLAG(handle); - if(rtk_parse_manager) - rtk_parse_manager->rtk_parse_l2cap_data(&send_buffer[1], 1); - - break; - - case DATA_TYPE_SCO: - p_buf->event = MSG_STACK_TO_HC_HCI_SCO; - break; default: p_buf->event = 0; ALOGE("%s invalid data type: %d", __func__, type); break; } - rtk_btsnoop_capture(p_buf, false); + rtk_btsnoop_capture(p_buf); } static void userial_coex_handler(void *context) -- 2.20.1