summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_private.h10
-rw-r--r--src/common/tusb_types.h4
2 files changed, 10 insertions, 4 deletions
diff --git a/src/common/tusb_private.h b/src/common/tusb_private.h
index 17ab267c3..91d213755 100644
--- a/src/common/tusb_private.h
+++ b/src/common/tusb_private.h
@@ -62,9 +62,10 @@ typedef struct {
uint8_t hwid; // device: rhport, host: daddr
bool is_host; // 1: host, 0: device
uint8_t ep_addr;
- uint16_t mps;
+ // 1 byte padding
- uint16_t ep_bufsize;
+ uint16_t mps;
+ uint16_t xfer_len;
uint8_t *ep_buf; // set to NULL to use xfer_fifo when CFG_TUD_EDPT_DEDICATED_HWFIFO = 1
tu_fifo_t ff;
@@ -102,7 +103,7 @@ bool tu_edpt_release(tu_edpt_state_t* ep_state, osal_mutex_t mutex);
// Init an endpoint stream
bool tu_edpt_stream_init(tu_edpt_stream_t *s, bool is_host, bool is_tx, bool overwritable, void *ff_buf,
- uint16_t ff_bufsize, uint8_t *ep_buf, uint16_t ep_bufsize);
+ uint16_t ff_bufsize, uint8_t *ep_buf);
// Deinit an endpoint stream
TU_ATTR_ALWAYS_INLINE static inline void tu_edpt_stream_deinit(tu_edpt_stream_t *s) {
@@ -119,10 +120,11 @@ TU_ATTR_ALWAYS_INLINE static inline void tu_edpt_stream_deinit(tu_edpt_stream_t
// Open an endpoint stream
TU_ATTR_ALWAYS_INLINE static inline void tu_edpt_stream_open(tu_edpt_stream_t *s, uint8_t hwid,
- const tusb_desc_endpoint_t *desc_ep) {
+ const tusb_desc_endpoint_t *desc_ep, uint16_t xfer_len) {
s->hwid = hwid;
s->ep_addr = desc_ep->bEndpointAddress;
s->mps = tu_edpt_packet_size(desc_ep);
+ s->xfer_len = xfer_len;
}
TU_ATTR_ALWAYS_INLINE static inline bool tu_edpt_stream_is_opened(const tu_edpt_stream_t *s) {
diff --git a/src/common/tusb_types.h b/src/common/tusb_types.h
index 8a48a0f04..a18f9feb7 100644
--- a/src/common/tusb_types.h
+++ b/src/common/tusb_types.h
@@ -115,6 +115,10 @@ enum {
TUSB_EPSIZE_ISO_HS_MAX = 1024,
};
+// Endpoint Bulk size depending on host/device max speed
+#define TUD_EPSIZE_BULK_MAX (TUD_OPT_HIGH_SPEED ? 512 : 64)
+#define TUH_EPSIZE_BULK_MAX (TUH_OPT_HIGH_SPEED ? 512 : 64)
+
/// Isochronous Endpoint Attributes
typedef enum {
TUSB_ISO_EP_ATT_NO_SYNC = 0x00,