Linux wireless drivers development
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Johnson Tsai <wenjie.tsai@realtek.com>,
	driver-core@lists.linux.dev
Subject: Re: [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute
Date: Tue, 19 May 2026 14:22:50 +0200	[thread overview]
Message-ID: <2026051957-refract-barge-b21e@gregkh> (raw)
In-Reply-To: <83ddb427597663b947c49afd835014f2bc1033f2.camel@sipsolutions.net>

On Tue, May 19, 2026 at 02:11:32PM +0200, Johannes Berg wrote:
> Hi,
> 
> > > Example usage from user-space:
> > >   $ cat /sys/bus/usb/devices/2-3.1.2:1.0/hw_info
> > >   SN: 36 42 00 01 23
> > >   UUID: aa ec 2b 7c 0a 55 47 27 8d e0 b3 0f eb cc bb aa
> 
> Sysfs has a "one value per file" rule (soft rule according to the docs,
> but harder in practice, I believe), so seems if anything that should be
> two files. Maybe a UUID should also be formatted as such with %pU or
> similar.

That should be 2 separate sysfs files please.

And yes, use %pU.

And be careful about exposing serial numbers to userspace, some systems
don't like normal users to read them so be sure to get the permissions
correct.  We had to add some USB code for ALLOW_SERIAL_NUMBER to make it
so that systems can handle this if they want to.

And shouldn't this just be the USB serial number to start with?  Why is
there a different string here?  We already have a sysfs file for this
value.

thanks,

greg k-h

  reply	other threads:[~2026-05-19 12:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19  7:24 [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute Ping-Ke Shih
2026-05-19  7:24 ` [RFC rtw-next 2/2] wifi: rtw89: usb: add sysfs write example Ping-Ke Shih
2026-05-19  7:37 ` [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute Ping-Ke Shih
2026-05-19 12:11   ` Johannes Berg
2026-05-19 12:22     ` Greg KH [this message]
2026-05-20  9:41       ` Johnson Tsai
2026-05-20 11:36         ` Greg KH
2026-05-20 19:32           ` [External Mail] " Elliot Saba

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=2026051957-refract-barge-b21e@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=driver-core@lists.linux.dev \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=wenjie.tsai@realtek.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