Skip to content

Commit a3be076

Browse files
mgrzeschikgregkh
authored andcommitted
net/9p/usbg: Add new usb gadget function transport
Add the new gadget function for 9pfs transport. This function is defining an simple 9pfs transport interface that consists of one in and one out endpoint. The endpoints transmit and receive the 9pfs protocol payload when mounting a 9p filesystem over usb. Tested-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Michael Grzeschik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d9c61bb commit a3be076

File tree

4 files changed

+982
-1
lines changed

4 files changed

+982
-1
lines changed

Documentation/filesystems/9p.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,25 @@ For server running on QEMU host with virtio transport::
4848

4949
mount -t 9p -o trans=virtio <mount_tag> /mnt/9
5050

51-
where mount_tag is the tag associated by the server to each of the exported
51+
where mount_tag is the tag generated by the server to each of the exported
5252
mount points. Each 9P export is seen by the client as a virtio device with an
5353
associated "mount_tag" property. Available mount tags can be
5454
seen by reading /sys/bus/virtio/drivers/9pnet_virtio/virtio<n>/mount_tag files.
5555

56+
USBG Usage
57+
==========
58+
59+
To mount a 9p FS on a USB Host accessible via the gadget at runtime::
60+
61+
mount -t 9p -o trans=usbg,aname=/path/to/fs <device> /mnt/9
62+
63+
To mount a 9p FS on a USB Host accessible via the gadget as root filesystem::
64+
65+
root=<device> rootfstype=9p rootflags=trans=usbg,cache=loose,uname=root,access=0,dfltuid=0,dfltgid=0,aname=/path/to/rootfs
66+
67+
where <device> is the tag associated by the usb gadget transport.
68+
It is defined by the configfs instance name.
69+
5670
Options
5771
=======
5872

@@ -68,6 +82,7 @@ Options
6882
virtio connect to the next virtio channel available
6983
(from QEMU with trans_virtio module)
7084
rdma connect to a specified RDMA channel
85+
usbg connect to a specified usb gadget channel
7186
======== ============================================
7287

7388
uname=name user name to attempt mount as on the remote server. The

net/9p/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ config NET_9P_XEN
4040
This builds support for a transport for 9pfs between
4141
two Xen domains.
4242

43+
config NET_9P_USBG
44+
bool "9P USB Gadget Transport"
45+
depends on USB_GADGET
46+
help
47+
This builds support for a transport for 9pfs over
48+
usb gadget.
4349

4450
config NET_9P_RDMA
4551
depends on INET && INFINIBAND && INFINIBAND_ADDR_TRANS

net/9p/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ obj-$(CONFIG_NET_9P_FD) += 9pnet_fd.o
44
obj-$(CONFIG_NET_9P_XEN) += 9pnet_xen.o
55
obj-$(CONFIG_NET_9P_VIRTIO) += 9pnet_virtio.o
66
obj-$(CONFIG_NET_9P_RDMA) += 9pnet_rdma.o
7+
obj-$(CONFIG_NET_9P_USBG) += 9pnet_usbg.o
78

89
9pnet-objs := \
910
mod.o \
@@ -23,3 +24,6 @@ obj-$(CONFIG_NET_9P_RDMA) += 9pnet_rdma.o
2324

2425
9pnet_rdma-objs := \
2526
trans_rdma.o \
27+
28+
9pnet_usbg-objs := \
29+
trans_usbg.o \

0 commit comments

Comments
 (0)