Skip to content

Commit 2c13965

Browse files
author
Josuah Demangeon
committed
remove list queueing for control endpoints
Control endpoints are an exception where a single transfer is handled at once, so no need to handle them through a queueue. As a consequence, their management can be simplified greatly.
1 parent 63eef35 commit 2c13965

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

drivers/usb/uhc/uhc_dwc2.c

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -854,15 +854,6 @@ struct uhc_dwc2_chan *uhc_dwc2_get_chan_pending_intr(const struct device *dev)
854854
}
855855
}
856856

857-
struct uhc_transfer *chan_get_next_xfer(struct uhc_dwc2_chan *chan)
858-
{
859-
struct uhc_transfer *xfer;
860-
sys_dnode_t *node;
861-
862-
node = sys_dlist_peek_head(&chan->xfer_pending_list);
863-
return (node == NULL) ? NULL : SYS_DLIST_CONTAINER(node, xfer, node);
864-
}
865-
866857
static inline uint16_t calc_packet_count(const uint16_t size, const uint8_t mps)
867858
{
868859
if (size == 0) {
@@ -906,23 +897,6 @@ static inline void _buffer_fill_ctrl(struct uhc_dwc2_chan *chan, struct uhc_tran
906897
/* TODO Sync data from cache to memory. For OUT and CTRL transfers */
907898
}
908899

909-
static void IRAM_ATTR _buffer_fill(struct uhc_dwc2_chan *chan)
910-
{
911-
struct uhc_transfer *xfer = chan_get_next_xfer(chan);
912-
913-
/* TODO: Double buffering scheme? */
914-
915-
switch (chan->type) {
916-
case UHC_DWC2_XFER_TYPE_CTRL:
917-
_buffer_fill_ctrl(chan, xfer);
918-
break;
919-
default:
920-
LOG_ERR("Unsupported transfer type %d", chan->type);
921-
break;
922-
}
923-
/* TODO: sync CACHE */
924-
}
925-
926900
static inline enum uhc_dwc2_ctrl_stage cal_next_pid(enum uhc_dwc2_ctrl_stage pid, uint8_t pkt_count)
927901
{
928902
if (pkt_count & 0x01) {
@@ -1636,10 +1610,7 @@ static inline int uhc_dwc2_submit_ctrl_xfer(const struct device *dev, struct uhc
16361610

16371611
key = irq_lock();
16381612

1639-
if (!sys_dlist_is_empty(&chan->xfer_pending_list)) {
1640-
_buffer_fill(chan);
1641-
}
1642-
1613+
_buffer_fill_ctrl(chan, xfer);
16431614
_buffer_exec(dev, chan);
16441615

16451616
irq_unlock(key);

0 commit comments

Comments
 (0)