static inline void bt_hci_lmp_acl_data(struct bt_hci_s *hci, uint16_t handle,

                const uint8_t *data, int start, int len)

{

    struct hci_acl_hdr *pkt = (void *) hci->acl_buf;



    /* TODO: packet flags */

    /* TODO: avoid memcpy'ing */



    if (len + HCI_ACL_HDR_SIZE > sizeof(hci->acl_buf)) {

        fprintf(stderr, "%s: can't take ACL packets %i bytes long\n",

                        __FUNCTION__, len);

        return;

    }

    memcpy(hci->acl_buf + HCI_ACL_HDR_SIZE, data, len);



    pkt->handle = cpu_to_le16(

                    acl_handle_pack(handle, start ? ACL_START : ACL_CONT));

    pkt->dlen = cpu_to_le16(len);

    hci->info.acl_recv(hci->info.opaque,

                    hci->acl_buf, len + HCI_ACL_HDR_SIZE);

}

static inline void bt_hci_lmp_acl_data(struct bt_hci_s *hci, uint16_t handle,

                const uint8_t *data, int start, int len)

{

    struct hci_acl_hdr *pkt = (void *) hci->acl_buf;



    

    



    if (len + HCI_ACL_HDR_SIZE > sizeof(hci->acl_buf)) {

        fprintf(stderr, "%s: can't take ACL packets %i bytes long\n",

                        __FUNCTION__, len);

        return;

    }

    memcpy(hci->acl_buf + HCI_ACL_HDR_SIZE, data, len);



    pkt->handle = cpu_to_le16(

                    acl_handle_pack(handle, start ? ACL_START : ACL_CONT));

    pkt->dlen = cpu_to_le16(len);

    hci->info.acl_recv(hci->info.opaque,

                    hci->acl_buf, len + HCI_ACL_HDR_SIZE);

}

static inline void FUNC_0(struct bt_hci_s *VAR_0, uint16_t VAR_1,

                const uint8_t *VAR_2, int VAR_3, int VAR_4)

{

    struct hci_acl_hdr *VAR_5 = (void *) VAR_0->acl_buf;



    

    



    if (VAR_4 + HCI_ACL_HDR_SIZE > sizeof(VAR_0->acl_buf)) {

        fprintf(stderr, "%s: can't take ACL packets %i bytes long\n",

                        __FUNCTION__, VAR_4);

        return;

    }

    memcpy(VAR_0->acl_buf + HCI_ACL_HDR_SIZE, VAR_2, VAR_4);



    VAR_5->VAR_1 = cpu_to_le16(

                    acl_handle_pack(VAR_1, VAR_3 ? ACL_START : ACL_CONT));

    VAR_5->dlen = cpu_to_le16(VAR_4);

    VAR_0->info.acl_recv(VAR_0->info.opaque,

                    VAR_0->acl_buf, VAR_4 + HCI_ACL_HDR_SIZE);

}

static inline void FUNC_0(struct bt_hci_s *VAR_0, uint16_t VAR_1,
const uint8_t *VAR_2, int VAR_3, int VAR_4)
{ struct hci_acl_hdr *VAR_5 = (void *) VAR_0->acl_buf; if (VAR_4 + HCI_ACL_HDR_SIZE > sizeof(VAR_0->acl_buf)) { fprintf(stderr, "%s: can't take ACL packets %i bytes long\n",
__FUNCTION__, VAR_4); return; } memcpy(VAR_0->acl_buf + HCI_ACL_HDR_SIZE, VAR_2, VAR_4); VAR_5->VAR_1 = cpu_to_le16(
acl_handle_pack(VAR_1, VAR_3 ? ACL_START : ACL_CONT)); VAR_5->dlen = cpu_to_le16(VAR_4); VAR_0->info.acl_recv(VAR_0->info.opaque,
VAR_0->acl_buf, VAR_4 + HCI_ACL_HDR_SIZE); }