Re: [net-next v7 2/4] net: wwan: t7xx: Add sysfs attribute for device state machine

Jinjian Song
2024-02-02T02:16:48Z

>Thu, Feb 01, 2024 at 04:13:38PM CET, songjinjian@hotmail.com wrote:
>>From: Jinjian Song <jinjian.song@fibocom.com>
>>
>>Add support for userspace to get/set the device mode, device's state machine
>>changes between (UNKNOWN/READY/RESET/FASTBOOT_DL_MODE/FASTBOOT_DUMP_MODE).
>>
>>diff --git a/Documentation/networking/device_drivers/wwan/t7xx.rst b/Documentation/networking/device_drivers/wwan/t7xx.rst
>>index dd5b731957ca..d13624a52d8b 100644
>>--- a/Documentation/networking/device_drivers/wwan/t7xx.rst
>>+++ b/Documentation/networking/device_drivers/wwan/t7xx.rst
>>@@ -39,6 +39,34 @@ command and receive response:
>>
>>+supports read and write operations.
>>+
>>+Device mode:
>>+
>>+- ``UNKNOW`` represents that device in unknown status
>
>should be "unknown", missing "n".
>
>Btw, why are you using capitals for the mode names?

Thanks, let me change it to lowercase and modify the word.
Previously considering it represents a state machine and with udev to report the state.

>>+- ``READY`` represents that device in ready status
>>+- ``RESET`` represents that device in reset status
>>+- ``FASTBOOT_DL_SWITCHING`` represents that device in fastboot switching status
>>+- ``FASTBOOT_DL_MODE`` represents that device in fastboot download status
>>+- ``FASTBOOT_DL_DUMP_MODE`` represents that device in fastboot dump status
>>+
>>+Read from userspace to get the current device mode.
>>+
>>+::
>>+ $ cat /sys/bus/pci/devices/${bdf}/t7xx_mode
>>+
>>+Write from userspace to set the device mode.
>>+
>>+::
>>+ $ echo FASTBOOT_DL_SWITCHING > /sys/bus/pci/devices/${bdf}/t7xx_mode
>>+
>>+static const char * const mode_names[] = {
>
>t7xx_mode_names

Let me rename it.

Best Regards,
Jinjian