Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Wi-Fi adapter Device ID to WLAN Interfaces #109

Open
jiribrejcha opened this issue Aug 24, 2023 · 1 comment
Open

Add Wi-Fi adapter Device ID to WLAN Interfaces #109

jiribrejcha opened this issue Aug 24, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jiribrejcha
Copy link
Member

Device ID (from lsusb output or file) to the WLAN Interfaces screen. Most of our current adapters use the same driver, so that won’t help. With M4, you can’t really tell what adapter has been installed without opening the case or SSH’ing in.

image

@jiribrejcha jiribrejcha added the enhancement New feature or request label Aug 24, 2023
@joshschmelzle
Copy link
Member

joshschmelzle commented Aug 24, 2023

Pseudo code which may be a helpful starting point for this:

        modalias = run_command(["cat", f"/sys/class/net/{iface}/device/modalias"])
        bus = modalias.split(":")[0]
        if bus == "usb":
            device_id = modalias.split(":")[1][1:10].replace("p", ":")
            # we have the device ID.
        if bus == "pci":
            vendor = run_command(
                ["cat", f"/sys/class/net/{iface}/device/vendor"]
            ).strip()
            device = run_command(
                ["cat", f"/sys/class/net/{iface}/device/device"]
            ).strip()
            device_id = f"{vendor}:{device}"
            # we have the device ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants