3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-05 03:29:24 +01:00
Commit Graph

175 Commits

Author SHA1 Message Date
Denis Kenzior
f8b724d3ba wsc/device: Use station_set_autoconnect 2018-09-04 23:57:14 -05:00
Denis Kenzior
b49ec9461b station: move the remaining scanning code from device 2018-09-04 23:57:14 -05:00
Denis Kenzior
58c8243114 device: Get rid of device_list queue 2018-09-04 23:57:14 -05:00
Denis Kenzior
553a8c1bae device/wsc: Use station_set_scan_results 2018-09-04 23:57:14 -05:00
Denis Kenzior
187ea7f5d1 device/network: Use station_is_busy 2018-09-04 23:57:14 -05:00
Denis Kenzior
5e2cce2e0b device: Remove unused device_get_connected_network 2018-09-04 23:57:14 -05:00
Denis Kenzior
1962549152 device: Remove device_network_find
Switch to using station_network_find instead
2018-09-04 23:57:14 -05:00
Denis Kenzior
dcfdd0ccde network: Use station_foreach
Instead of __iwd_device_foreach api, use the newly introduced
station_foreach API
2018-09-04 23:57:14 -05:00
Denis Kenzior
d576c28d9f device: Remove device_get_path
Use netdev_get_path instead
2018-09-04 23:57:14 -05:00
Denis Kenzior
993a69cef8 network: Make network station centric 2018-09-04 23:57:14 -05:00
Denis Kenzior
b69f938879 device: Get rid of connected_bss member 2018-09-04 23:57:14 -05:00
Denis Kenzior
e6c6e4f0ae device: Get rid of connected_network member 2018-09-04 23:57:14 -05:00
Denis Kenzior
575d0fa554 station: Move roam triggering & scanning code
Move the roam initiation (signal loss, ap directed roaming) and scanning
details into station from device.  Certain device functions have been
exposed temporarily to make this possible.
2018-09-04 23:57:14 -05:00
Denis Kenzior
e028b7019c station: Move state tracking from device 2018-09-04 23:57:14 -05:00
Denis Kenzior
1378a3c945 station: Move scanning code from device 2018-09-04 23:57:14 -05:00
Denis Kenzior
9b574b5931 station: Move autoconnect logic from device 2018-09-04 23:57:14 -05:00
Denis Kenzior
977b817f3c device: Modify signature of device_set_scan_results
WSC was using this to set the scan results.  However it never needed the
autoconnect paths, so modify the signature to make this explicit.
2018-09-04 23:57:14 -05:00
Denis Kenzior
345485c506 device: Split process_bss
process_bss performs two main operations.  It adds a seen BSS to a
network object (existing or new) and if the device is in the autoconnect
state, it adds an autoconnect entry as needed.  Split this operation
into two separate & independent steps.
2018-09-04 23:57:14 -05:00
Denis Kenzior
e6060c1026 station: Move handshake setup code from device
For now we temporarily create the station object from within device so
that the code can be moved over in a more manageable manner.
2018-08-31 20:25:23 -05:00
Denis Kenzior
839053c952 device: Get rid of timestamp parameter in process_bss
This is no longer being used
2018-08-31 14:53:56 -05:00
Andrew Zaborowski
5f3cdc2093 handshake: Rename own_ie/ap_ie and related setters
To avoid confusion in case of an authenticator side handshake_state
structure and eapol_sm structure, rename own_ie to supplicant_ie and
ap_ie to authenticator_ie.  Also rename
handshake_state_set_{own,ap}_{rsn,wpa} and fix when we call
handshake_state_setup_own_ciphers.  As a result
handshake_state_set_authenticator, if needed, should be called before
handshake_state_set_{own,ap}_{rsn,wpa}.
2018-08-27 11:42:45 -05:00
Andrew Zaborowski
c0a70cc9b7 device: Drop now unused start/stop_ap_pending fields 2018-08-23 21:43:33 -05:00
Denis Kenzior
7e7bf126d3 device: Remove device_get_netdev 2018-08-19 23:37:29 -05:00
Denis Kenzior
92e7e63af5 device: Remove device_get_ifindex 2018-08-19 23:30:06 -05:00
Denis Kenzior
1ad22021d2 device: Remove device_get_address 2018-08-19 23:28:58 -05:00
Denis Kenzior
a277a424f3 device: Remove unneeded typedefs/enums 2018-08-19 23:10:27 -05:00
Denis Kenzior
99b5c67c88 device: Update State when Mode is changed 2018-08-19 22:41:07 -05:00
Denis Kenzior
5a6c19988c device/netdev: Properly implement mode switching 2018-08-19 22:07:15 -05:00
Denis Kenzior
93985103bb device: Use netdev->iftype instead of device_mode 2018-08-19 20:39:37 -05:00
Denis Kenzior
f6eb571b67 device: Set autoconnect only if triggered via D-Bus 2018-08-18 00:41:25 -05:00
Denis Kenzior
b7fd5023f0 device: Honor autoconnect setting on power up
If the device Powered state is toggled, honor the autoconnect setting
instead of always going into AUTOCONNECT mode
2018-08-18 00:40:45 -05:00
Denis Kenzior
996a6d2546 netdev/device: Combine watches
There was somewhat overlapping functionality in the device_watch
infrastructure as well as the netdev_event_watch.  This commit combines
the two into a single watch based on the netdev object and cleans up the
various interface additions / removals.

With this commit the interfaces are created when the netdev/device is
switched to Powered=True state AND when the netdev iftype is also in the
correct state for that interface.  If the device is brought down, then
all interfaces except the .Device interface are removed.

This will make it easy to implement Device.Mode property properly since
most nl80211 devices need to be brought into Powered=False state prior
to switching the iftype.
2018-08-18 00:38:56 -05:00
Denis Kenzior
c530667ed1 device: Send .Aborted error if property set fails
If a property setting is canceled before the callback is generated, then
generate an .Aborted error the the method return
2018-08-17 14:10:13 -05:00
Denis Kenzior
3a9b1f2e38 device: Return an error if netdev_set_powered fails
netdev_set_powered could in theory return an error.  So handle this
case by returning an error from the property set call.
2018-08-17 14:10:13 -05:00
Denis Kenzior
1f512ff85c device: Move device_init/device_exit to iwd.h 2018-08-14 14:57:19 -05:00
James Prestwood
fd8671e9c5 netdev: added sae functionality to netdev
In order to plug SAE into the existing connect mechanism the actual
CMD_CONNECT message is never sent, rather sae_register takes care
of sending out CMD_AUTHENTICATE. This required some shuffling of
code in order to handle both eapol and sae. In the case of non-SAE
authentication everything behaves as it did before. When using SAE
an sae_sm is created when a connection is attempted but the eapol_sm
is not. After SAE succeeds it will start association and then create
the eapol_sm and start the 4-way handshake.

This change also adds the handshake SAE events to device and
initializes SAE in main.
2018-08-14 10:37:52 -05:00
Denis Kenzior
70acf2dcb4 device: rename SignalLevelChanged to Changed 2018-08-13 20:40:59 -05:00
James Prestwood
d256e97b32 device: added SUITE_SAE_SHA256 to _select_akm_suite 2018-08-09 14:57:41 -05:00
Andrew Zaborowski
319b6416de network: Stop tracking network last seen times
Drop the corresponding network_info field, function and D-Bus property.
The last seen times didn't seem useful but if a client needs them it can
probably implement the same logic with the information already available
through DBus.
2018-07-31 10:55:32 -05:00
Andrew Zaborowski
97913c6f9a network: Refactor and move Known Networks management
Until now network.c managed the list of network_info structs including
for known networks and networks that are seen in at least one device's
scan results, with the is_known flag to distinguish known networks.
Each time the list was processed though the code was either interested
in one subset of networks or the other.  Split the list into a Known
Networks list and the list of other networks seen in scans.  Move all
code related to Known Networks to knownnetworks.c, this simplifies
network.h.  It also gets rid of network_info_get_known which actually
returned the list of all network_infos (not just for known networks),
which logically should have been private to network.c.  Update device.c
and scan.c to use functions specific to Known Networks instead of
filtering the lists by the is_known flag.

This will also allow knownnetworks.c to export DBus objects and/or
properties for the Known Networks information because it now knows when
Known Networks are added, removed or modified by IWD.
2018-07-25 09:40:14 -05:00
James Prestwood
8cf44499d1 device: added DEVICE_EVENT_MODE_CHANGED
Rather than have device.c manage the creation/removal of
AP/AdHoc interfaces this new event was introduced. Now
anyone can listen for device events and if the mode changes
handle accordingly. This fixes potential memory leaks
in WSC when switching modes as well.
2018-07-17 18:52:59 -05:00
James Prestwood
bf3a171e3a device: added ad-hoc mode
As with station/ap, a new mode was added for ad-hoc
2018-07-17 16:55:59 -05:00
Tim Kourt
d83dda410d device: fix incomplete variable replacement 2018-07-13 11:41:49 -05:00
Christian Hesse
22e5ba2133 device: make the output less verbose
Having hidden SSIDs or SSIDs with non-UTF8 characters around make iwd
flood the logs with messages. Make iwd less verbose and show these
messages with enabled debug output only.
2018-07-13 10:39:02 -05:00
Denis Kenzior
d744915534 device: Rework device_hidden_network_scan_results
Rework the logic slightly to simplify the need for error labels.  Also
the connect_pending variable might not have been properly reset to NULL
in case of error, so make sure we reset it prior to calling into
network_connect_new_hidden_network
2018-07-11 15:59:51 -05:00
Tim Kourt
d8c8ebdf3a device: enable connection to the hidden networks
1) Change signature of process_bss to return a confirmation
   that bss has been added to a network otherwise we can
   discard it.

2) Implements logic for the discovery and connection to
   a hidden network.
2018-07-11 15:36:14 -05:00
James Prestwood
b2f27f3abe netdev: fixed key setting failure
If netdev fails to set the keys, there was no way for device/ap to
know. A new handshake event was added for this. The key setting
failure function was also fixed to support both AP/station iftypes.
It will now automatically send either a disconnect or del_station
depending on the interface type.

In similar manner, netdev_handshake_failed was also modified to
support both AP/station iftypes. Now, any handshake event listeners
should call netdev_handshake_failed upon a handshake failure
event, including AP.
2018-07-03 16:45:25 -05:00
James Prestwood
d4e521027b device: add debug prints for mode switching
Its useful to know when the device has switched modes
2018-07-03 16:15:54 -05:00
Denis Kenzior
5b8f052524 device: Don't return an error on no state change
If device is already disconnected or in autoconnect mode, don't return
an error if .Disconnect is called.  Instead simply silently return
success after disabling autoconnect.
2018-07-03 16:13:39 -05:00
Denis Kenzior
73e0394d7f device: Use dbus_error_from_errno in .Disconnect 2018-07-03 16:12:04 -05:00