Skip to content

Commit c2d00d5

Browse files
jfischer-nocfriedt
authored andcommitted
sample: net: remove legacy USB code from the zperf sample
Remove legacy netusb code. Signed-off-by: Johann Fischer <[email protected]>
1 parent 5edefa3 commit c2d00d5

File tree

6 files changed

+12
-82
lines changed

6 files changed

+12
-82
lines changed

samples/net/zperf/overlay-netusb.conf

Lines changed: 0 additions & 6 deletions
This file was deleted.

samples/net/zperf/sample.yaml

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -41,74 +41,32 @@ tests:
4141
extra_configs:
4242
- CONFIG_ZPERF_SESSION_PER_THREAD=y
4343
platform_allow: qemu_x86
44-
sample.net.zperf.netusb_ecm:
45-
harness: net
46-
extra_args: EXTRA_CONF_FILE="overlay-netusb.conf"
47-
tags:
48-
- usb
49-
- net
50-
- zperf
51-
depends_on: usb_device
52-
# native_sim usb driver does not work with CONFIG_POSIX_API
53-
platform_exclude:
54-
- native_sim
55-
- native_sim/native/64
56-
sample.net.zperf.device_next_ecm:
44+
sample.net.zperf.usbd_cdc_ecm:
5745
harness: net
5846
extra_args:
59-
- EXTRA_CONF_FILE="overlay-usbd_next.conf"
60-
- DTC_OVERLAY_FILE="usbd_next_ecm.overlay"
47+
- EXTRA_CONF_FILE="overlay-usbd.conf"
48+
- DTC_OVERLAY_FILE="usbd_cdc_ecm.overlay"
6149
platform_allow:
6250
- nrf52840dk/nrf52840
6351
- frdm_k64f
6452
tags:
6553
- usb
6654
- net
6755
- zperf
68-
depends_on: usb_device
69-
sample.net.zperf.device_next_ncm:
56+
depends_on: usbd
57+
sample.net.zperf.usbd_cdc_ncm:
7058
harness: net
7159
extra_args:
72-
- EXTRA_CONF_FILE="overlay-usbd_next.conf"
73-
- DTC_OVERLAY_FILE="usbd_next_ncm.overlay"
60+
- EXTRA_CONF_FILE="overlay-usbd.conf"
61+
- DTC_OVERLAY_FILE="usbd_cdc_ncm.overlay"
7462
platform_allow:
7563
- nrf52840dk/nrf52840
7664
- frdm_k64f
7765
tags:
7866
- usb
7967
- net
8068
- zperf
81-
depends_on: usb_device
82-
sample.net.zperf.netusb_eem:
83-
harness: net
84-
extra_args: EXTRA_CONF_FILE="overlay-netusb.conf"
85-
extra_configs:
86-
- CONFIG_USB_DEVICE_NETWORK_ECM=n
87-
- CONFIG_USB_DEVICE_NETWORK_EEM=y
88-
tags:
89-
- usb
90-
- net
91-
- zperf
92-
depends_on: usb_device
93-
# native_sim usb driver does not work with CONFIG_POSIX_API
94-
platform_exclude:
95-
- native_sim
96-
- native_sim/native/64
97-
sample.net.zperf.netusb_rndis:
98-
harness: net
99-
extra_args: EXTRA_CONF_FILE="overlay-netusb.conf"
100-
extra_configs:
101-
- CONFIG_USB_DEVICE_NETWORK_ECM=n
102-
- CONFIG_USB_DEVICE_NETWORK_RNDIS=y
103-
tags:
104-
- usb
105-
- net
106-
- zperf
107-
depends_on: usb_device
108-
# native_sim usb driver does not work with CONFIG_POSIX_API
109-
platform_exclude:
110-
- native_sim
111-
- native_sim/native/64
69+
depends_on: usbd
11270
sample.net.zperf.shield:
11371
harness: net
11472
platform_allow: reel_board

samples/net/zperf/src/main.c

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* @file
99
* @brief Zperf sample.
1010
*/
11-
#include <zephyr/usb/usb_device.h>
1211
#include <zephyr/usb/usbd.h>
1312
#include <zephyr/net/net_config.h>
1413

@@ -20,11 +19,12 @@ LOG_MODULE_REGISTER(zperf, CONFIG_NET_ZPERF_LOG_LEVEL);
2019

2120
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
2221
#include <sample_usbd.h>
22+
#endif
2323

24-
static struct usbd_context *sample_usbd;
25-
26-
static int enable_usb_device_next(void)
24+
int main(void)
2725
{
26+
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
27+
struct usbd_context *sample_usbd;
2828
int err;
2929

3030
sample_usbd = sample_usbd_init_device(NULL);
@@ -37,28 +37,6 @@ static int enable_usb_device_next(void)
3737
return err;
3838
}
3939

40-
return 0;
41-
}
42-
#endif /* CONFIG_USB_DEVICE_STACK_NEXT */
43-
44-
int main(void)
45-
{
46-
#if defined(CONFIG_USB_DEVICE_STACK)
47-
int ret;
48-
49-
ret = usb_enable(NULL);
50-
if (ret != 0) {
51-
printk("usb enable error %d\n", ret);
52-
}
53-
54-
(void)net_config_init_app(NULL, "Initializing network");
55-
#endif /* CONFIG_USB_DEVICE_STACK */
56-
57-
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
58-
if (enable_usb_device_next()) {
59-
return 0;
60-
}
61-
6240
(void)net_config_init_app(NULL, "Initializing network");
6341
#endif /* CONFIG_USB_DEVICE_STACK_NEXT */
6442

0 commit comments

Comments
 (0)