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

Commit 50964e39 authored by Matthew Xie's avatar Matthew Xie Committed by Gerrit Code Review
Browse files

Merge "Bluedroid: Fix HCI buffer size issue"

parents 9bdb42e2 4604ad0f
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -62,9 +62,8 @@
#endif
#endif  // (BTHC_LINUX_BASE_POLICY != SCHED_NORMAL)

#ifndef BTHC_USERIAL_READ_MEM_SIZE
#define BTHC_USERIAL_READ_MEM_SIZE (1024)
#endif
#define HCI_ACL_MAX_SIZE 1024
#define HCI_MAX_FRAME_SIZE (HCI_ACL_MAX_SIZE + 4)

#ifndef BTSNOOPDISP_INCLUDED
#define BTSNOOPDISP_INCLUDED TRUE
+3 −4
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@
#endif

#define MAX_SERIAL_PORT (USERIAL_PORT_3 + 1)
#define READ_LIMIT (BTHC_USERIAL_READ_MEM_SIZE - BT_HC_HDR_SIZE)

enum {
    USERIAL_RX_EXIT,
@@ -254,8 +253,8 @@ static void *userial_read_thread(void *arg)
    {
        if (bt_hc_cbacks)
        {
            p_buf = (HC_BT_HDR *) bt_hc_cbacks->alloc( \
                                                BTHC_USERIAL_READ_MEM_SIZE);
            p_buf = (HC_BT_HDR *) bt_hc_cbacks->alloc(
                        BT_HC_HDR_SIZE + HCI_MAX_FRAME_SIZE + 1); /* H4 HDR = 1 */
        }
        else
            p_buf = NULL;
@@ -266,7 +265,7 @@ static void *userial_read_thread(void *arg)
            p_buf->layer_specific = 0;

            p = (uint8_t *) (p_buf + 1);
            rx_length = select_read(userial_cb.fd, p, READ_LIMIT);
            rx_length = select_read(userial_cb.fd, p, HCI_MAX_FRAME_SIZE + 1);
        }
        else
        {