/* Vendor handler is executed in the ISR context, queue data for later processing  */
static int wpanusb_vendor_handler(struct usb_setup_packet *setup, int32_t *len, uint8_t **data)
/* Vendor handler is executed in the ISR context, queue data for later processing  */
static int wpanusb_vendor_handler(struct usb_setup_packet *setup, int32_t *len, uint8_t **data)
{
	struct net_pkt *pkt;
	if (usb_reqtype_is_to_host(setup)) {
		return -ENOTSUP;
	}
	pkt = net_pkt_alloc_with_buffer(NULL, *len + 2, AF_UNSPEC, 0,
					K_NO_WAIT);
	if (!pkt) {
		return -ENOMEM;
	}
	net_pkt_write_u8(pkt, setup->bRequest);
	if (setup->bRequest == TX) {
		net_pkt_write_u8(pkt, setup->wIndex);
	}
	net_pkt_write(pkt, *data, *len);
	LOG_DBG("pkt %p len %u seq %u", pkt, *len, setup->wIndex);
	k_fifo_put(&tx_queue, pkt);
	return 0;
}