Lines Matching refs:rx

76 } rx;  variable
83 net_buf_add_mem(buf, rx.hdr, rx.hdr_len); in copy_hdr()
88 rx.type = H4_NONE; in reset_rx()
89 rx.remaining = 0; in reset_rx()
90 rx.have_hdr = false; in reset_rx()
91 rx.hdr_len = 0; in reset_rx()
92 rx.discardable = false; in reset_rx()
97 struct bt_hci_evt_hdr *hdr = &rx.evt; in get_evt_hdr()
99 rx.hdr_len = sizeof(struct bt_hci_evt_hdr); in get_evt_hdr()
100 memcpy((uint8_t *)hdr, data, rx.hdr_len); in get_evt_hdr()
102 if (rx.evt.evt == BT_HCI_EVT_LE_META_EVENT) { in get_evt_hdr()
103 memcpy((uint8_t *)hdr + rx.hdr_len, data + rx.hdr_len, 1); in get_evt_hdr()
104 rx.hdr_len++; in get_evt_hdr()
107 if (rx.evt.evt == BT_HCI_EVT_LE_META_EVENT && in get_evt_hdr()
108 rx.hdr[sizeof(*hdr)] == BT_HCI_EVT_LE_ADVERTISING_REPORT) { in get_evt_hdr()
110 rx.discardable = true; in get_evt_hdr()
113 rx.remaining = hdr->len - (rx.hdr_len - sizeof(*hdr)); in get_evt_hdr()
115 rx.have_hdr = true; in get_evt_hdr()
117 return rx.hdr_len; in get_evt_hdr()
122 struct bt_hci_acl_hdr *hdr = &rx.acl; in get_acl_hdr()
124 rx.hdr_len = sizeof(struct bt_hci_acl_hdr); in get_acl_hdr()
125 memcpy((uint8_t *)hdr, data, rx.hdr_len); in get_acl_hdr()
127 rx.remaining = sys_le16_to_cpu(hdr->len); in get_acl_hdr()
128 BT_DBG("Got ACL header. Payload %u bytes", rx.remaining); in get_acl_hdr()
129 rx.have_hdr = true; in get_acl_hdr()
131 return rx.hdr_len; in get_acl_hdr()
136 BT_DBG("type 0x%02x, evt 0x%02x", rx.type, rx.evt.evt); in get_rx()
138 if (rx.type == H4_EVT && (rx.evt.evt == BT_HCI_EVT_CMD_COMPLETE || in get_rx()
139 rx.evt.evt == BT_HCI_EVT_CMD_STATUS)) { in get_rx()
160 rx.type = *pdata; in h4_receive()
163 switch (rx.type) { in h4_receive()
173 BT_ERR("Unknown H:4 type 0x%02x", rx.type); in h4_receive()
174 rx.type = H4_NONE; in h4_receive()
178 if (!rx.buf) { in h4_receive()
179 rx.buf = get_rx(K_NO_WAIT); in h4_receive()
181 if (!rx.buf) { in h4_receive()
182 if (rx.discardable) { in h4_receive()
183 BT_WARN("Discarding event 0x%02x", rx.evt.evt); in h4_receive()
184 rx.discard = rx.remaining; in h4_receive()
193 copy_hdr(rx.buf); in h4_receive()
196 net_buf_add_mem(rx.buf, pdata, rx.remaining); in h4_receive()
198 prio = (rx.type == H4_EVT && bt_hci_evt_is_prio(rx.evt.evt)); in h4_receive()
200 buf = rx.buf; in h4_receive()
201 rx.buf = NULL; in h4_receive()
203 if (rx.type == H4_EVT) { in h4_receive()