Linux USB
 help / color / mirror / Atom feed
From: Jakub Lecki <lec.jakub@gmail.com>
To: Valentina Manea <valentina.manea.m@gmail.com>,
	 Shuah Khan <shuah@kernel.org>, Hongren Zheng <i@zenithal.me>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Jakub Lecki <lec.jakub@gmail.com>
Subject: [PATCH 0/2] usbip: Cleanup of sysfs attributes.
Date: Fri, 12 Jun 2026 00:10:57 +0200	[thread overview]
Message-ID: <20260612-usbip-attribute-cleanup-v1-0-8de3aa76867e@gmail.com> (raw)

Hi!

This patchset is a prerequisite and a follow-up to my previous proposal
to parameterize the number of vhci controllers and the number of ports
[1], where Greg suggested that new parameters should be implemented in
sysfs/configfs.

Before doing that though, existing sysfs attributes must be cleaned up
as it's very unintuitive in present form.

First commit aims to align `usbip_debug` attribute that is shared
between drivers, to the expected usage. It controls the global debug
flag, therefore creating multiple instances of it in all of the driver's
devices makes no sense. At the same time it also allows to get rid of
manual attributes creation in vhci_hcd drivers in the next commit.

The second commit segregates the existing vhci_hcd sysfs attributes.
Before it, the first vhci device was used as an 'user interface' to the
driver. That required recognition of the first device and custom
handling in usb controller start function. With this change, the
driver-level attributes for attaching/detaching and getting number of
ports are defined as driver_attribute, and `status` attribute is
automatically created for each of vhci devices.

Thanks to that, future implementation of parametrized num_controllers
and ports will be much simpler as the fist device doesn't need to be
specially handled and doesn't control other devices which are now
handled by the driver.

[1] https://lore.kernel.org/linux-usb/20251104113248.223594-1-lec.jakub@gmail.com/

Signed-off-by: Jakub Lecki <lec.jakub@gmail.com>
---
Jakub Lecki (2):
      usbip: Convert usbip_debug to driver attribute.
      usbip: Cleanup of vhci_hcd attributes.

 drivers/usb/usbip/stub_dev.c          |  10 ++-
 drivers/usb/usbip/usbip_common.c      |  14 ++--
 drivers/usb/usbip/usbip_common.h      |   2 +-
 drivers/usb/usbip/vhci.h              |   6 +-
 drivers/usb/usbip/vhci_hcd.c          |  71 ++++++------------
 drivers/usb/usbip/vhci_sysfs.c        | 132 +++++-----------------------------
 tools/usb/usbip/libsrc/sysfs_utils.c  |  23 ++++++
 tools/usb/usbip/libsrc/sysfs_utils.h  |   1 +
 tools/usb/usbip/libsrc/usbip_common.h |   2 +
 tools/usb/usbip/libsrc/vhci_driver.c  |  61 ++++++++++------
 10 files changed, 126 insertions(+), 196 deletions(-)
---
base-commit: 9716c086c8e8b141d35aa61f2e96a2e83de212a7
change-id: 20260611-usbip-attribute-cleanup-7515b9ff2872

Best regards,
-- 
Jakub Lecki <lec.jakub@gmail.com>


             reply	other threads:[~2026-06-11 22:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 22:10 Jakub Lecki [this message]
2026-06-11 22:10 ` [PATCH 1/2] usbip: Convert usbip_debug to driver attribute Jakub Lecki
2026-06-11 22:10 ` [PATCH 2/2] usbip: Cleanup of vhci_hcd attributes Jakub Lecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260612-usbip-attribute-cleanup-v1-0-8de3aa76867e@gmail.com \
    --to=lec.jakub@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=i@zenithal.me \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=valentina.manea.m@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox