<p><b>@dylad</b> commented on this pull request.</p>

<p>Some nitpicks<br>
Tested work on SAME54-XPRO using tests/usbus<br>
CDC-ECM is still working too.</p><hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325819922">tests/usbus/main.c</a>:</p>
<pre style='color:#555'>> +{
+    switch (state) {
+        case TEST_REQ_PHASE_IDLE:
+            return "idle";
+        case TEST_REQ_PHASE_START_GET:
+            return "start get";
+        case TEST_REQ_PHASE_START_SET:
+            return "start set";
+        case TEST_REQ_PHASE_OUTDATA:
+            return "OUT data";
+        case TEST_REQ_PHASE_INDATA:
+            return "IN data";
+        case TEST_REQ_PHASE_OUTACK:
+            return "OUT Ack";
+        case TEST_REQ_PHASE_INACK:
+            return "IN Ack";
</pre>
<p>missing default statement</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325822330">tests/usbus/main.c</a>:</p>
<pre style='color:#555'>> +    /* Validate direction and content for the current state */
+    switch (req_phase) {
+        case TEST_REQ_PHASE_START_GET:
+            _validate_get_req_start(ep);
+            _handle_data(dev, ep, len);
+            break;
+        case TEST_REQ_PHASE_START_SET:
+            _validate_set_req_start(dev, ep, len);
+            break;
+        case TEST_REQ_PHASE_OUTACK:
+            _validate_out_ack(dev, ep);
+            break;
+        case TEST_REQ_PHASE_INACK:
+            _validate_in_ack(dev, ep, len);
+            break;
+        default:
</pre>
<p>please add a DEBUG statement</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325823017">tests/usbus/tests/01-run.py</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
+# Copyright (C) 2016 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
</pre>
<p>Hmmmmm, really ?</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325823438">tests/usbus/usbdev_mock.c</a>:</p>
<pre style='color:#555'>> +#define ENABLE_DEBUG    (0)
+#include "debug.h"
+
+static usbdev_mock_t usbdev_mock;
+static uint8_t _in_buf[256];    /* "host" in */
+static uint8_t _out_buf[64];    /* "host" out */
+
+static const usbdev_driver_t testdriver;
+
+static usbdev_mock_t *_ep2dev(usbdev_ep_t *ep)
+{
+    return (usbdev_mock_t *)ep->dev;
+}
+
+void usbdev_init_lowlevel(void)
+{}
</pre>
⬇️ Suggested change
<pre style="color: #555">-{}
+{
+
+}
</pre>


<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325823736">tests/usbus/usbdev_mock.c</a>:</p>
<pre style='color:#555'>> +                       usbdev_mock_ready_cb_t ready_cb)
+{
+    memset(&usbdev_mock, 0, sizeof(usbdev_mock));
+    usbdev_mock.usbdev.driver = &testdriver;
+
+    usbdev_mock.esr_cb = esr_cb;
+    usbdev_mock.ep_esr_cb = ep_esr_cb;
+    usbdev_mock.ready_cb = ready_cb;
+}
+
+static void _init(usbdev_t *usbdev)
+{
+    usbdev_mock_t *dev = (usbdev_mock_t *)usbdev;
+
+    /* Init fake usbdev */
+
</pre>
<p>Missing call or forgot to remove comment ?</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325826852">tests/usbus/usbdev_mock.h</a>:</p>
<pre style='color:#555'>> +typedef struct {
+    usbdev_ep_t ep;                 /**< Generic endpoint struct        */
+    usbdev_mock_ep_state_t state;   /**< Endpoint state                 */
+    size_t available;               /**< Bytes available in the buffer  */
+    uint8_t *buf_start;             /**< Start location of the buffer   */
+} usbdev_mock_ep_t;
+
+/**
+ * @brief usbdev mock device forward declaration
+ */
+typedef struct usbdev_mock usbdev_mock_t;
+
+/**
+ * @brief usbdev mock device callback for esr event checking
+ *
+ * @param dev   usbdev mock device state
</pre>
<p>You should change this description<br>
Same for all functions within this file using dev arg</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/12267?email_source=notifications&email_token=ABE7WYCJQJIGTK3LHHY6R6DQKJXHVA5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFFKZHY#pullrequestreview-290106527">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYCFV24QOEDL676V3KDQKJXHVANCNFSM4IXUWNCQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYEGZUQEI2TARILX5L3QKJXHVA5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFFKZHY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/12267?email_source=notifications\u0026email_token=ABE7WYCJQJIGTK3LHHY6R6DQKJXHVA5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFFKZHY#pullrequestreview-290106527",
"url": "https://github.com/RIOT-OS/RIOT/pull/12267?email_source=notifications\u0026email_token=ABE7WYCJQJIGTK3LHHY6R6DQKJXHVA5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFFKZHY#pullrequestreview-290106527",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>