2017-09-25 18:44:47 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* USB definitions
|
|
|
|
*/
|
|
|
|
|
2018-02-08 17:01:01 +08:00
|
|
|
#define NETUSB_MTU 1500
|
|
|
|
|
2018-06-21 00:07:29 +08:00
|
|
|
#define CDC_ECM_INT_EP_ADDR 0x83
|
|
|
|
#define CDC_ECM_IN_EP_ADDR 0x82
|
|
|
|
#define CDC_ECM_OUT_EP_ADDR 0x01
|
|
|
|
|
|
|
|
#define CDC_EEM_OUT_EP_ADDR 0x01
|
|
|
|
#define CDC_EEM_IN_EP_ADDR 0x82
|
|
|
|
|
|
|
|
#define RNDIS_INT_EP_ADDR 0x83
|
|
|
|
#define RNDIS_IN_EP_ADDR 0x82
|
|
|
|
#define RNDIS_OUT_EP_ADDR 0x01
|
|
|
|
|
2017-09-25 18:44:47 +08:00
|
|
|
struct netusb_function {
|
|
|
|
int (*connect_media)(bool status);
|
2017-11-03 21:41:58 +08:00
|
|
|
int (*send_pkt)(struct net_pkt *pkt);
|
2017-09-25 18:44:47 +08:00
|
|
|
};
|
|
|
|
|
2017-11-03 21:27:46 +08:00
|
|
|
void netusb_recv(struct net_pkt *pkt);
|
2017-09-25 18:44:47 +08:00
|
|
|
int try_write(u8_t ep, u8_t *data, u16_t len);
|
2017-11-03 22:21:26 +08:00
|
|
|
|
2018-10-05 21:43:36 +08:00
|
|
|
void netusb_enable(const struct netusb_function *func);
|
2018-05-15 21:19:08 +08:00
|
|
|
void netusb_disable(void);
|
2018-10-04 14:25:20 +08:00
|
|
|
bool netusb_enabled(void);
|