diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-11-09 11:24:00 +0100 |
---|---|---|
committer | Rosen Penev <rosenp@gmail.com> | 2021-11-12 11:00:04 -0800 |
commit | 9bc59425290d03e41699fe862132507716e18882 (patch) | |
tree | 138c5e884952712ce14e68f3ddbb39f34988bc08 /net/modemmanager | |
parent | 024ac2b040de92b59848b5cb9ac778a7c2f854a0 (diff) |
modemmanager: fix physdev sysfs path detection in PCIe modems
The PCIe physdev path lookup relies on the 'vendor' and 'device'
attribute files, instead of the 'idVendor' and 'idProduct' ones, which
are USB specific.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Diffstat (limited to 'net/modemmanager')
-rw-r--r-- | net/modemmanager/files/modemmanager.common | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/net/modemmanager/files/modemmanager.common b/net/modemmanager/files/modemmanager.common index b898a7798..b4139abad 100644 --- a/net/modemmanager/files/modemmanager.common +++ b/net/modemmanager/files/modemmanager.common @@ -39,12 +39,21 @@ mm_find_physdev_sysfs_path() { # avoid infinite loops iterating [ -z "${tmp_path}" ] || [ "${tmp_path}" = "/" ] && return - # the physical device will be that with a idVendor and idProduct pair of files + # For USB devices, the physical device will be that with a idVendor + # and idProduct pair of files [ -f "${tmp_path}"/idVendor ] && [ -f "${tmp_path}"/idProduct ] && { tmp_path=$(readlink -f "$tmp_path") echo "${tmp_path}" return } + + # For PCI devices, the physical device will be that with a vendor + # and device pair of files + [ -f "${tmp_path}"/vendor ] && [ -f "${tmp_path}"/device ] && { + tmp_path=$(readlink -f "$tmp_path") + echo "${tmp_path}" + return + } done } |