Skip to content

Commit d22c0d2

Browse files
jfischer-nokartben
authored andcommitted
usb: usbip: add initial support for USBIP server
The server uses host support to export a USB device to a remote USBIP client. It supports control and bulk transfers, interrupt transfers may also work, but this depends on the host controller used. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
1 parent c8f3a2e commit d22c0d2

File tree

5 files changed

+921
-0
lines changed

5 files changed

+921
-0
lines changed

subsys/usb/host/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ zephyr_library_sources_ifdef(
1616
usbh_shell.c
1717
)
1818

19+
zephyr_library_sources_ifdef(
20+
CONFIG_USBIP
21+
usbip.c
22+
)
23+
1924
zephyr_linker_sources(DATA_SECTIONS usbh_data.ld)

subsys/usb/host/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,6 @@ config USBH_MAX_UHC_MSG
5353
help
5454
Maximum number of USB host controller events that can be queued.
5555

56+
rsource "Kconfig.usbip"
57+
5658
endif # USB_HOST_STACK

subsys/usb/host/Kconfig.usbip

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
menuconfig USBIP
6+
bool "USB USBIP support"
7+
select EXPERIMENTAL
8+
select EVENTS
9+
depends on NETWORKING
10+
depends on NET_IPV4
11+
depends on NET_TCP
12+
depends on NET_SOCKETS
13+
help
14+
Experimental USB USBIP support.
15+
16+
if USBIP
17+
18+
config USBIP_THREAD_STACK_SIZE
19+
int "USBIP thread stack size"
20+
default 2048
21+
help
22+
USBIP thread stack size in bytes.
23+
24+
config USBIP_SUBMIT_BACKLOG_COUNT
25+
int "Number of submit commands in the backlog"
26+
range 32 128
27+
default 48
28+
help
29+
Number of submit commands that can be stored in the backlog.
30+
31+
config USBIP_DEVICES_COUNT
32+
int "Number of devices that can be exported"
33+
range 1 255
34+
default 1
35+
help
36+
Number of devices that can be exported.
37+
38+
module = USBIP
39+
module-str = usbip
40+
source "subsys/logging/Kconfig.template.log_config"
41+
42+
endif # USBIP

0 commit comments

Comments
 (0)