summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2026-12-03 11:21:19 +0800
committersakumisu <[email protected]>2026-12-03 11:21:19 +0800
commit83f798c6ea203edcd88aaf3f35bc7624b9d862fb (patch)
treea1abd7e2a62315c87b752427cb5b8a81b34c1417
parentec565d44acf9dcfaae74a801ad27ca179bbc05ba (diff)
update(urb): change urb list to doubleHEADmaster
Signed-off-by: sakumisu <[email protected]>
-rw-r--r--common/usb_hc.h2
-rw-r--r--common/usb_list.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/common/usb_hc.h b/common/usb_hc.h
index f24c337e..d72e342d 100644
--- a/common/usb_hc.h
+++ b/common/usb_hc.h
@@ -34,7 +34,7 @@ struct usbh_iso_frame_packet {
* Structure containing the USB Urb configuration.
*/
struct usbh_urb {
- usb_slist_t list;
+ usb_dlist_t list;
void *hcpriv;
struct usbh_hubport *hport;
struct usb_endpoint_descriptor *ep;
diff --git a/common/usb_list.h b/common/usb_list.h
index 3078a1f2..1cd52f44 100644
--- a/common/usb_list.h
+++ b/common/usb_list.h
@@ -204,9 +204,9 @@ static inline int usb_slist_isempty(usb_slist_t *l)
#define usb_slist_for_each(pos, head) \
for (pos = (head)->next; pos != NULL; pos = pos->next)
-#define usb_slist_for_each_safe(pos, next, head) \
- for (pos = (head)->next, next = pos->next; pos; \
- pos = next, next = pos->next)
+#define usb_slist_for_each_safe(pos, n, head) \
+ for (pos = (head)->next, n = pos ? pos->next : NULL; pos; \
+ pos = n, n = pos ? pos->next : NULL)
/**
* usb_slist_for_each_entry - iterate over single list of given type