]> www.infradead.org Git - users/hch/misc.git/commit
net: wwan: t7xx: Add sysfs attribute for device state machine
authorJinjian Song <jinjian.song@fibocom.com>
Mon, 5 Feb 2024 10:22:28 +0000 (18:22 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Feb 2024 12:07:48 +0000 (12:07 +0000)
commit409c38d4f156740bf3165fd6ceae4fa6425eebf4
treeda0b2c9eb3f03056b505c32561657bb4b8a452e2
parente3caf184107a4e2e196528b98b218ddc41e4cb8c
net: wwan: t7xx: Add sysfs attribute for device state machine

Add support for userspace to get/set the device mode, device's state
machine changes between (unknown/ready/reset/fastboot).

Get the device state mode:
 - 'cat /sys/bus/pci/devices/${bdf}/t7xx_mode'

Set the device state mode:
 - reset(cold reset): 'echo reset > /sys/bus/pci/devices/${bdf}/t7xx_mode'
 - fastboot: 'echo fastboot_switching > /sys/bus/pci/devices/${bdf}/t7xx_mode'
Reload driver to get the new device state after setting operation.

Signed-off-by: Jinjian Song <jinjian.song@fibocom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/device_drivers/wwan/t7xx.rst
drivers/net/wwan/t7xx/t7xx_modem_ops.c
drivers/net/wwan/t7xx/t7xx_modem_ops.h
drivers/net/wwan/t7xx/t7xx_pci.c
drivers/net/wwan/t7xx/t7xx_pci.h
drivers/net/wwan/t7xx/t7xx_state_monitor.c