Skip to content

[PW_SID:1030712] device: Improve errors when station not present#485

Open
IWDTestBot wants to merge 11 commits intoworkflowfrom
1030712
Open

[PW_SID:1030712] device: Improve errors when station not present#485
IWDTestBot wants to merge 11 commits intoworkflowfrom
1030712

Conversation

@IWDTestBot
Copy link
Owner

When a user attempts to use station commands (scan, get-networks,
connect, disconnect, show) on a device that does not have a station
interface available, iwctl currently displays the generic error message
"No station on device: 'wlan0'". This message is quite broad and does
not really help users understand why the station interface is
unavailable.

The station interface can be unavailable for several distinct reasons:

  1. The device does not exist (invalid device name)
  2. The device is not in station mode (device is in AP mode or ad-hoc
    mode instead)
  3. The device is rfkilled (either hardware rfkill via physical button or
    software rfkill via rfkill utility)
  4. The device is not powered for other reasons (manual ifdown, driver
    issues, etc.)

The current implementation simply checks if the station interface exists
and displays the same generic message for all of these cases, which is
particularly confusing when the device is rfkilled, as users may not
immediately understand that "No station on device" means the device is
rfkilled.

This commit improves the error messages by checking the device state and
providing specific error messages for each scenario.

client/adapter.c | 12 ++++++++++++
client/adapter.h | 25 +++++++++++++++++++++++++
client/device.c | 31 +++++++++++++++++++++++++++++++
client/device.h | 2 ++
client/station.c | 18 +++++++++++++-----
5 files changed, 83 insertions(+), 5 deletions(-)
create mode 100644 client/adapter.h

jprestwo and others added 11 commits September 25, 2025 13:42
This is taken care of by the individual cache items and
if none exist, tar fails.
When a user attempts to use station commands (scan, get-networks,
connect, disconnect, show) on a device that does not have a station
interface available, iwctl currently displays the generic error message
"No station on device: 'wlan0'". This message is quite broad and does
not really help users understand why the station interface is
unavailable.

The station interface can be unavailable for several distinct reasons:

1. The device does not exist (invalid device name)
2. The device is not in station mode (device is in AP mode or ad-hoc
   mode instead)
3. The device is rfkilled (either hardware rfkill via physical button or
   software rfkill via rfkill utility)
4. The device is not powered for other reasons (manual ifdown, driver
   issues, etc.)

The current implementation simply checks if the station interface exists
and displays the same generic message for all of these cases, which is
particularly confusing when the device is rfkilled, as users may not
immediately understand that "No station on device" means the device is
rfkilled.

This commit improves the error messages by checking the device state and
providing specific error messages for each scenario.
@IWDTestBot
Copy link
Owner Author

Fetch PR
Test ID: fetch
Desc: Fetch the PR commits for this CI run
Duration: 3.23 seconds
Result: PASS

Prep - Setup ELL
Test ID: setupell
Desc: Clone, build, and install ELL
Duration: 25.79 seconds
Result: PASS

Make Distcheck
Test ID: makedistcheck
Desc: Run distcheck to check the distribution
Duration: 31.51 seconds
Result: FAIL

Output:

../../client/adapter.c:31:10: fatal error: client/adapter.h: No such file or directory
   31 | #include "client/adapter.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:2663: client/adapter.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1800: all] Error 2
make: *** [Makefile:3461: distcheck] Error 1

Build - Configure
Test ID: build
Desc: Configure the BlueZ source tree
Duration: 10.12 seconds
Result: PASS

Make Check
Test ID: makecheck
Desc: Run 'make check'
Duration: 1.60 seconds
Result: PASS

Make Check w/Valgrind
Test ID: makecheckvalgrind
Desc: Run 'make check' with Valgrind
Duration: 71.23 seconds
Result: PASS

Incremental Build with patches
Test ID: incremental_build
Desc: Incremental build per patch in the series
Duration: 0.46 seconds
Result: PASS

@IWDTestBot
Copy link
Owner Author

Fetch PR
Test ID: fetch
Desc: Fetch the PR commits for this CI run
Duration: 2.36 seconds
Result: PASS

GitLint
Test ID: gitlint
Desc: Run gitlint with rule in .gitlint
Duration: 0.44 seconds
Result: PASS

Prep - Setup ELL
Test ID: setupell
Desc: Clone, build, and install ELL
Duration: 27.35 seconds
Result: PASS

Make Distcheck
Test ID: makedistcheck
Desc: Run distcheck to check the distribution
Duration: 20.96 seconds
Result: FAIL

Output:

../../client/adapter.c:31:10: fatal error: client/adapter.h: No such file or directory
   31 | #include "client/adapter.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:2662: client/adapter.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1799: all] Error 2
make: *** [Makefile:3460: distcheck] Error 1

Build - Configure
Test ID: build
Desc: Configure the BlueZ source tree
Duration: 18.83 seconds
Result: PASS

Make Check
Test ID: makecheck
Desc: Run 'make check'
Duration: 6.85 seconds
Result: PASS

Make Check w/Valgrind
Test ID: makecheckvalgrind
Desc: Run 'make check' with Valgrind
Duration: 104.42 seconds
Result: PASS

Incremental Build with patches
Test ID: incremental_build
Desc: Incremental build per patch in the series
Duration: 0.43 seconds
Result: PASS

Autotest Runner
Test ID: testrunner
Desc: Runs IWD's autotest framework
Duration: 2079.62 seconds
Result: FAIL

Output:

testAPRoam

Clang Build
Test ID: clang
Desc: Build IWD using clang compiler
Duration: 104.79 seconds
Result: PASS

@github-actions github-actions bot force-pushed the workflow branch 2 times, most recently from 34cec50 to 720e28a Compare February 10, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants