blob: 9fa43d07489a95e8145cc9757f04b24e2b5be1cb [file] [log] [blame]
/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* USB definitions
*/
struct netusb_function {
int num_ep;
struct usb_ep_cfg_data *ep;
int (*init)(void);
int (*connect_media)(bool status);
int (*send_pkt)(struct net_pkt *pkt);
int (*class_handler)(struct usb_setup_packet *setup, s32_t *len,
u8_t **data);
};
void netusb_recv(struct net_pkt *pkt);
int try_write(u8_t ep, u8_t *data, u16_t len);
#if defined(CONFIG_USB_DEVICE_NETWORK_ECM)
#define NETUSB_IFACE_IDX FIRST_IFACE_CDC_ECM
struct netusb_function ecm_function;
#elif defined(CONFIG_USB_DEVICE_NETWORK_RNDIS)
#define NETUSB_IFACE_IDX FIRST_IFACE_RNDIS
struct netusb_function rndis_function;
#else
#error Unknown USB Device Networking function
#endif