* Re: [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute
[not found] ` <efb61959e14e4f57b78fbd49a563398e@realtek.com>
@ 2026-05-19 12:11 ` Johannes Berg
2026-05-19 12:22 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2026-05-19 12:11 UTC (permalink / raw)
To: Ping-Ke Shih, linux-wireless@vger.kernel.org; +Cc: Johnson Tsai, driver-core
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.
> I also looked up lore.kernel.org and only found a thread commented by Kalle [1].
> However, it is not clear to us if sysfs is suitable to read efuse SN/UUID.
>
> [1] https://lore.kernel.org/linux-wireless/87ziib3da5.fsf@kamboji.qca.qualcomm.com/
It seems to me this was more in the context of _writable_ files to do
some operations.
I don't think I have a problem with this, but sysfs also has
documentation requirements, and we should probably ask
driver-core@lists.linux.dev.
I'm not really quite sure I see the _point_ of identifying the serial
number of a wifi device in a container, but I guess you do.
johannes
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute
2026-05-19 12:11 ` [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute Johannes Berg
@ 2026-05-19 12:22 ` Greg KH
2026-05-20 9:41 ` Johnson Tsai
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2026-05-19 12:22 UTC (permalink / raw)
To: Johannes Berg
Cc: Ping-Ke Shih, linux-wireless@vger.kernel.org, Johnson Tsai,
driver-core
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute
2026-05-19 12:22 ` Greg KH
@ 2026-05-20 9:41 ` Johnson Tsai
2026-05-20 11:36 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Johnson Tsai @ 2026-05-20 9:41 UTC (permalink / raw)
To: Greg KH, Johannes Berg
Cc: Ping-Ke Shih, linux-wireless@vger.kernel.org,
driver-core@lists.linux.dev, sabae@valvesoftware.com,
Charles Lohr
On Tuesday, May 19, 2026 20:23, Greg KH <gregkh@linuxfoundation.org> wrote:
> 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.
The v2 patch will use separate `sn` and `uuid` attributes, with `uuid`
formatted via `%pU`. We also removed the spaces in `sn` to provide a clean
string.
Example usage from user-space:
$ cat /sys/bus/usb/devices/2-3.1.2:1.0/sn
3642000123
$ cat /sys/bus/usb/devices/2-3.1.2:1.0/uuid
aaec2b7c-0a55-4727-8de0-b30febccbbaa
>
> 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.
Regarding the serial number and permission design, these are requirements
from Valve, so we have CC'd them here to provide the background.
Hi Elliot and Charles, could you please help explain the requirements and use case here?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute
2026-05-20 9:41 ` Johnson Tsai
@ 2026-05-20 11:36 ` Greg KH
2026-05-20 19:32 ` [External Mail] " Elliot Saba
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2026-05-20 11:36 UTC (permalink / raw)
To: Johnson Tsai
Cc: Johannes Berg, Ping-Ke Shih, linux-wireless@vger.kernel.org,
driver-core@lists.linux.dev, sabae@valvesoftware.com,
Charles Lohr
On Wed, May 20, 2026 at 09:41:46AM +0000, Johnson Tsai wrote:
>
>
> On Tuesday, May 19, 2026 20:23, Greg KH <gregkh@linuxfoundation.org> wrote:
> > 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.
>
> The v2 patch will use separate `sn` and `uuid` attributes, with `uuid`
> formatted via `%pU`. We also removed the spaces in `sn` to provide a clean
> string.
>
> Example usage from user-space:
> $ cat /sys/bus/usb/devices/2-3.1.2:1.0/sn
> 3642000123
> $ cat /sys/bus/usb/devices/2-3.1.2:1.0/uuid
> aaec2b7c-0a55-4727-8de0-b30febccbbaa
Wait, no, you are putting attributes in the USB interface device, which
is NOT the device your driver is creating. Don't do that, it makes for
massive confusion.
> > 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.
>
> Regarding the serial number and permission design, these are requirements
> from Valve, so we have CC'd them here to provide the background.
>
> Hi Elliot and Charles, could you please help explain the requirements and use case here?
The USB serial number is already exported in sysfs, why export it again
under a different filename? That's ripe for total confusion :(
Also, where does this random UUID come from? That's not part of the USB
spec, is it? Why is it not just a USB string attribute like the spec
says to use for stuff like this?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [External Mail] Re: [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute
2026-05-20 11:36 ` Greg KH
@ 2026-05-20 19:32 ` Elliot Saba
2026-05-21 10:57 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Elliot Saba @ 2026-05-20 19:32 UTC (permalink / raw)
To: Greg KH, Johnson Tsai
Cc: Johannes Berg, Ping-Ke Shih, linux-wireless@vger.kernel.org,
driver-core@lists.linux.dev, Charles Lohr
Hello Greg, Johannes, thank you for your time and feedback on this patchset.
The purpose of this information is to provide access to two pieces of information, a serial number (also printed on the outside of the device, used for product tracking, RMAs, etc...) and a GUID (random entropy that is intentionally difficult to guess).
We use the GUID to establish a direct connection between the USB network adapter and another device.
To directly answer your USB questions, unfortunately the ASIC used in this product does not support customization of the USB serial number; all devices have the same USB serial number. Indeed, I believe there is no mutable state on the device at all except for the e-fuses that are written at the factory to write these two values. Given those constraints, we're trying to find the best way to raise this up to userspace, and we're grateful for your feedback.
This USB device is expected to operate on both Windows and Linux hosts, on the Windows side we have a custom driver that allows our host application (Steam) to directly query these fuses and setup the network connection appropriately. We're attempting to upstream this capability as much as possible so that users running a vanilla kernel can take advantage of these features as much as possible.
With regards to permissions, we'd really like to make this serial number readable by non-root users so that the pairing functionality can work out-of-the-box without needing special udev/tmpfiles.d rules to adjust permissions to allow Steam to read this information, but we are simultaneously sympathetic to the desire to limit trackable/identifying information by default. Of course we can adjust permissions however needed for our own Linux distribution, but in our effort to support the rest of the Linux ecosystem as best we can, we'd like to do our best to find a solution that would work everywhere. We're open to comparing against any existing precedent for devices that necessarily require identifying information to perform their basic function, if you know of any.
Thank you,
-Elliot Saba
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [External Mail] Re: [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute
2026-05-20 19:32 ` [External Mail] " Elliot Saba
@ 2026-05-21 10:57 ` Greg KH
2026-05-21 13:06 ` Johnson Tsai
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2026-05-21 10:57 UTC (permalink / raw)
To: Elliot Saba
Cc: Johnson Tsai, Johannes Berg, Ping-Ke Shih,
linux-wireless@vger.kernel.org, driver-core@lists.linux.dev,
Charles Lohr
On Wed, May 20, 2026 at 07:32:13PM +0000, Elliot Saba wrote:
> Hello Greg, Johannes, thank you for your time and feedback on this patchset.
>
> The purpose of this information is to provide access to two pieces of information, a serial number (also printed on the outside of the device, used for product tracking, RMAs, etc...) and a GUID (random entropy that is intentionally difficult to guess).
> We use the GUID to establish a direct connection between the USB network adapter and another device.
>
> To directly answer your USB questions, unfortunately the ASIC used in this product does not support customization of the USB serial number; all devices have the same USB serial number. Indeed, I believe there is no mutable state on the device at all except for the e-fuses that are written at the factory to write these two values. Given those constraints, we're trying to find the best way to raise this up to userspace, and we're grateful for your feedback.
Then where exactly does that "serial number" come from in the device so
that it can be read by the kernel, if not in the USB device itself?
> This USB device is expected to operate on both Windows and Linux hosts, on the Windows side we have a custom driver that allows our host application (Steam) to directly query these fuses and setup the network connection appropriately. We're attempting to upstream this capability as much as possible so that users running a vanilla kernel can take advantage of these features as much as possible.
Great, why can't this driver also query the fuses?
> With regards to permissions, we'd really like to make this serial number readable by non-root users so that the pairing functionality can work out-of-the-box without needing special udev/tmpfiles.d rules to adjust permissions to allow Steam to read this information, but we are simultaneously sympathetic to the desire to limit trackable/identifying information by default. Of course we can adjust permissions however needed for our own Linux distribution, but in our effort to support the rest of the Linux ecosystem as best we can, we'd like to do our best to find a solution that would work everywhere. We're open to comparing against any existing precedent for devices that necessarily require identifying information to perform their basic function, if you know of any.
My objection is the placement of random sysfs files in the USB device
directory, for something that is not a USB device-specific thing, but
rather a driver-specific thing. If this is a driver/device bound
specific thing, then put it in the device that the driver creates and
owns. NOT in the device that the USB core creates and owns.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [External Mail] Re: [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute
2026-05-21 10:57 ` Greg KH
@ 2026-05-21 13:06 ` Johnson Tsai
2026-05-21 13:11 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Johnson Tsai @ 2026-05-21 13:06 UTC (permalink / raw)
To: Greg KH, Elliot Saba
Cc: Johannes Berg, Ping-Ke Shih, linux-wireless@vger.kernel.org,
driver-core@lists.linux.dev, Charles Lohr
On Thursday, May 21, 2026 18:58, Greg KH wrote:
> On Wed, May 20, 2026 at 07:32:13PM +0000, Elliot Saba wrote:
> > Hello Greg, Johannes, thank you for your time and feedback on this
> patchset.
> >
> > The purpose of this information is to provide access to two pieces of
> information, a serial number (also printed on the outside of the device, used
> for product tracking, RMAs, etc...) and a GUID (random entropy that is
> intentionally difficult to guess).
> > We use the GUID to establish a direct connection between the USB network
> adapter and another device.
> >
> > To directly answer your USB questions, unfortunately the ASIC used in this
> product does not support customization of the USB serial number; all devices
> have the same USB serial number. Indeed, I believe there is no mutable state
> on the device at all except for the e-fuses that are written at the factory to
> write these two values. Given those constraints, we're trying to find the best
> way to raise this up to userspace, and we're grateful for your feedback.
>
> Then where exactly does that "serial number" come from in the device so that
> it can be read by the kernel, if not in the USB device itself?
The "serial number" we're talking about right now is not exposed through the standard
USB descriptors. It is obtained via a vendor-specific H2C (Host-to-Chip)
command, which reads EFUSE data into the rtw89 driver.
Both SN and UUID are stored as specific fields within that data block.
>
> > This USB device is expected to operate on both Windows and Linux hosts,
> on the Windows side we have a custom driver that allows our host application
> (Steam) to directly query these fuses and setup the network connection
> appropriately. We're attempting to upstream this capability as much as
> possible so that users running a vanilla kernel can take advantage of these
> features as much as possible.
>
> Great, why can't this driver also query the fuses?
Yes, the driver can query the fuses directly, similar to the Windows driver
implementation.
In this RFC v1, the H2C implementation is intentionally omitted to keep the discussion
focused on the sysfs interface design and gather early feedback from the
community.
>
> > With regards to permissions, we'd really like to make this serial number
> readable by non-root users so that the pairing functionality can work out-of-
> the-box without needing special udev/tmpfiles.d rules to adjust permissions
> to allow Steam to read this information, but we are simultaneously
> sympathetic to the desire to limit trackable/identifying information by default.
> Of course we can adjust permissions however needed for our own Linux
> distribution, but in our effort to support the rest of the Linux ecosystem as
> best we can, we'd like to do our best to find a solution that would work
> everywhere. We're open to comparing against any existing precedent for
> devices that necessarily require identifying information to perform their basic
> function, if you know of any.
>
> My objection is the placement of random sysfs files in the USB device
> directory, for something that is not a USB device-specific thing, but rather a
> driver-specific thing. If this is a driver/device bound specific thing, then put it
> in the device that the driver creates and owns. NOT in the device that the USB
> core creates and owns.
>
We completely agree with your concern. Since accessing these values requires
driver-specific commands rather than standard USB requests, they should not live
under the USB device directory.
In the upcoming v2 patchset, we will move these attributes under the wiphy device
managed by the rtw89 driver. The paths will be something like:
$ cat /sys/class/ieee80211/phy0/sn
3642000123
$ cat /sys/class/ieee80211/phy0/uuid
aaec2b7c-0a55-4727-8de0-b30febccbbaa
Additionally, these sysfs attributes will be strictly limited to Valve's specific VID/PID
pair and will not be exposed on generic RTL8852CU devices.
Thanks,
Johnson
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [External Mail] Re: [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute
2026-05-21 13:06 ` Johnson Tsai
@ 2026-05-21 13:11 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2026-05-21 13:11 UTC (permalink / raw)
To: Johnson Tsai
Cc: Elliot Saba, Johannes Berg, Ping-Ke Shih,
linux-wireless@vger.kernel.org, driver-core@lists.linux.dev,
Charles Lohr
On Thu, May 21, 2026 at 01:06:09PM +0000, Johnson Tsai wrote:
>
> On Thursday, May 21, 2026 18:58, Greg KH wrote:
> > On Wed, May 20, 2026 at 07:32:13PM +0000, Elliot Saba wrote:
> > > Hello Greg, Johannes, thank you for your time and feedback on this
> > patchset.
> > >
> > > The purpose of this information is to provide access to two pieces of
> > information, a serial number (also printed on the outside of the device, used
> > for product tracking, RMAs, etc...) and a GUID (random entropy that is
> > intentionally difficult to guess).
> > > We use the GUID to establish a direct connection between the USB network
> > adapter and another device.
> > >
> > > To directly answer your USB questions, unfortunately the ASIC used in this
> > product does not support customization of the USB serial number; all devices
> > have the same USB serial number. Indeed, I believe there is no mutable state
> > on the device at all except for the e-fuses that are written at the factory to
> > write these two values. Given those constraints, we're trying to find the best
> > way to raise this up to userspace, and we're grateful for your feedback.
> >
> > Then where exactly does that "serial number" come from in the device so that
> > it can be read by the kernel, if not in the USB device itself?
>
> The "serial number" we're talking about right now is not exposed through the standard
> USB descriptors. It is obtained via a vendor-specific H2C (Host-to-Chip)
> command, which reads EFUSE data into the rtw89 driver.
> Both SN and UUID are stored as specific fields within that data block.
Ick, ok, gotta love custom USB commands :(
> > > This USB device is expected to operate on both Windows and Linux hosts,
> > on the Windows side we have a custom driver that allows our host application
> > (Steam) to directly query these fuses and setup the network connection
> > appropriately. We're attempting to upstream this capability as much as
> > possible so that users running a vanilla kernel can take advantage of these
> > features as much as possible.
> >
> > Great, why can't this driver also query the fuses?
>
> Yes, the driver can query the fuses directly, similar to the Windows driver
> implementation.
> In this RFC v1, the H2C implementation is intentionally omitted to keep the discussion
> focused on the sysfs interface design and gather early feedback from the
> community.
Great, put these on the network device that you create as they are not a
generic USB attribute, and properly document them in Documentation/ABI/
>
> >
> > > With regards to permissions, we'd really like to make this serial number
> > readable by non-root users so that the pairing functionality can work out-of-
> > the-box without needing special udev/tmpfiles.d rules to adjust permissions
> > to allow Steam to read this information, but we are simultaneously
> > sympathetic to the desire to limit trackable/identifying information by default.
> > Of course we can adjust permissions however needed for our own Linux
> > distribution, but in our effort to support the rest of the Linux ecosystem as
> > best we can, we'd like to do our best to find a solution that would work
> > everywhere. We're open to comparing against any existing precedent for
> > devices that necessarily require identifying information to perform their basic
> > function, if you know of any.
> >
> > My objection is the placement of random sysfs files in the USB device
> > directory, for something that is not a USB device-specific thing, but rather a
> > driver-specific thing. If this is a driver/device bound specific thing, then put it
> > in the device that the driver creates and owns. NOT in the device that the USB
> > core creates and owns.
> >
>
> We completely agree with your concern. Since accessing these values requires
> driver-specific commands rather than standard USB requests, they should not live
> under the USB device directory.
Great
> In the upcoming v2 patchset, we will move these attributes under the wiphy device
> managed by the rtw89 driver. The paths will be something like:
>
> $ cat /sys/class/ieee80211/phy0/sn
> 3642000123
Spell it out, you have almost unlimited number of characters for a file name :)
> $ cat /sys/class/ieee80211/phy0/uuid
> aaec2b7c-0a55-4727-8de0-b30febccbbaa
>
> Additionally, these sysfs attributes will be strictly limited to Valve's specific VID/PID
> pair and will not be exposed on generic RTL8852CU devices.
Great, please document it as such.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-05-21 13:11 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260519072415.25746-1-pkshih@realtek.com>
[not found] ` <efb61959e14e4f57b78fbd49a563398e@realtek.com>
2026-05-19 12:11 ` [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute Johannes Berg
2026-05-19 12:22 ` Greg KH
2026-05-20 9:41 ` Johnson Tsai
2026-05-20 11:36 ` Greg KH
2026-05-20 19:32 ` [External Mail] " Elliot Saba
2026-05-21 10:57 ` Greg KH
2026-05-21 13:06 ` Johnson Tsai
2026-05-21 13:11 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox