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

1563 Commits

Author SHA1 Message Date
Denis Kenzior
d95f9a29c5 device: Simplify reply logic in device_connect_cb
Also, remove the check for device->state == DEVICE_STATE_CONNECTING.
device_connect_cb should always called when the state is CONNECTING.
If this is not so, it indicates a bug inside the netdev layer.
2016-08-04 12:22:43 -05:00
Denis Kenzior
f4201d06c2 device: Remove pointless check
This was introduced by commit f468fceb02.
However, after commit 2d78f51fac66b9beff03a56f12e5fb8456625f07, the
connect_cb is called from inside netdev_disconnect.  This in turn causes
the dbus-reply to be sent out if needed.  So by the time we get to the
code in question, connect_pending is always NULL.
2016-08-04 12:22:42 -05:00
Andrew Zaborowski
c4eab62ba4 netdev: Improve netdev_connect error/cancel logic
Try to make the connect and disconnect operations look more like a
transaction where the callback is always called eventually, also with a
clear indication if the operation is in profress.  The connected state
lasts from the start of the connection attempt until the disconnect.

1. Non-null netdev->connected or disconnect_cb indicate that the operation
   is active.
2. Every entry-point in netdev.c checks if connected is still set
   before executing the next step of the connection setup.  CMD_CONNECT and
   the subsequent commands may succeed even if CMD_DISCONNECT is called
   in the middle so they can't only rely on the error value for that.
3. netdev->connect_cb and other elements of the connection state are
   reset by netdev_connect_free which groups the clean-up operations to
   make sure we don't miss anything.  Since the callback pointers are
   reset device.c doesn't need to check that it receives a spurious
   event in those callbacks for example after calling netdev_disconnect.
2016-08-04 12:21:44 -05:00
Andrew Zaborowski
8f90df6f44 device: Only build autoconnect_list in autoconnect mode 2016-08-02 15:49:43 -05:00
Rahul Rahul
866ff95c48 autotests: utility: fix helper functions 2016-08-02 15:21:25 -05:00
Rahul Rahul
eb605d9105 autotests: test2AP: Make tests pass in test-runner 2016-08-02 15:20:19 -05:00
Rahul Rahul
6a4f24c920 autotests: test1AP: fix hw.conf for test-runner 2016-08-02 15:19:21 -05:00
Andrew Zaborowski
f76a86d2b0 netdev: Add a NETDEV_RESULT_ABORTED
To be used so that the callback passed to netdev_connect can still
be called when the connection attempt is being aborted.
2016-08-01 13:18:24 -05:00
Andrew Zaborowski
3863f6d2bb netdev: Allow ERFKILL during initial bring up
If initial bring up returns ERFKILL proceed and the inteface can be
explicitly brought up by the client once rfkill is disabled.

Also fix the error number returned to netdev_set_powered callback to be
negative as expected by netdev_initial_up_cb.
2016-08-01 13:13:24 -05:00
Andrew Zaborowski
50b5234976 netdev: Fix use of l_genl_msg_unref in netdev_connect
Also drop netdev.associate_msg which is now unused.
2016-08-01 12:49:07 -05:00
Andrew Zaborowski
55f8942d8f test: Show Adapter properties in list-devices 2016-08-01 12:45:48 -05:00
Denis Kenzior
d362ce83b9 autotests: Fix permissions for *.conf files 2016-07-22 15:02:28 -05:00
Rahul Rahul
575d928bbb autotests: utility - added utility functions 2016-07-22 14:39:15 -05:00
Rahul Rahul
67dc10707a autotests: test1AP - added new tests and config files
APShutdownTest - shutdown the AP after network connection. This
                 will be replaced when hwsim supports signal
                 strength modification
InvalidPassphraseTest -  Provide an invalid passphrase.
2016-07-22 14:38:57 -05:00
Denis Kenzior
b5e06633dc doc: Don't go over 80 characters 2016-07-20 15:44:28 -05:00
Denis Kenzior
169222fb96 eapol: warn if state machine list isn't empty 2016-07-20 15:34:21 -05:00
Andrew Zaborowski
efbf56c0f2 doc: Update device-api.txt with State property 2016-07-20 15:30:43 -05:00
Andrew Zaborowski
9f5c08f3df device: Add a State read-only property 2016-07-20 15:30:17 -05:00
Andrew Zaborowski
f316614f59 rfkill: Fix wiphy ID lookup
map_wiphy made the assumption that phy names follow the "phyN" pattern
but phys created or renamed by the "iw" command can have arbitrary
names.  It seems that /sys/class/rfkill/rfkill%u/name is not updated on
a phy rename, so we can't use it to subsequently read
/sys/class/ieee80211/<name>/index but both
/sys/class/rfkill/rfkill%u/../index and
/sys/class/rfkill/rfkill%u/device/index point to that file.
2016-07-20 15:29:39 -05:00
Denis Kenzior
fba5ada1a1 netdev: Make enum naming consistent with guidelines 2016-07-19 18:03:21 -05:00
Denis Kenzior
1c5438d3ab netdev: simplify 2016-07-19 17:52:36 -05:00
Denis Kenzior
480332226d netdev: Fix memory leak:
==3059== 7 bytes in 1 blocks are still reachable in loss record 1 of 2
==3059==    at 0x4C2C970: malloc (vg_replace_malloc.c:296)
==3059==    by 0x50BB319: strndup (in /lib64/libc-2.22.so)
==3059==    by 0x417B4D: l_strndup (util.c:180)
==3059==    by 0x417E1B: l_strsplit (util.c:311)
==3059==    by 0x4057FC: netdev_init (netdev.c:1658)
==3059==    by 0x402E26: nl80211_appeared (main.c:112)
==3059==    by 0x41F577: get_family_callback (genl.c:1038)
==3059==    by 0x41EE3F: process_unicast (genl.c:390)
==3059==    by 0x41EE3F: received_data (genl.c:506)
==3059==    by 0x41C6F4: io_callback (io.c:120)
==3059==    by 0x41BAA9: l_main_run (main.c:381)
==3059==    by 0x402B9C: main (main.c:234)
2016-07-19 17:48:21 -05:00
Denis Kenzior
295ccf62d5 netdev: Properly cleanup removed interfaces 2016-07-19 17:45:48 -05:00
Denis Kenzior
22b599df5a device: Print warning if device list isn't empty 2016-07-19 16:49:37 -05:00
Denis Kenzior
de6dddce76 netdev: Remove redundant associate_msg 2016-07-19 16:22:24 -05:00
Denis Kenzior
c977b8092c netdev: Skip non-STA interfaces 2016-07-19 16:03:26 -05:00
Denis Kenzior
94f204b994 netdev: Act on NEW_INTERFACE & DEL_INTERFACE cmds 2016-07-19 16:02:37 -05:00
Denis Kenzior
37ea99d09e netdev: Remove netdev_new_wiphy_hint 2016-07-19 15:49:22 -05:00
Denis Kenzior
83500c9516 TODO: Add additional tasks 2016-07-18 13:58:25 -05:00
Denis Kenzior
a4a7ea6b20 TODO: Take ownership of GET_INTERFACE filtering 2016-07-18 11:29:27 -05:00
Denis Kenzior
1e94f8c5ee TODO: Remove redundant task 2016-07-18 11:28:00 -05:00
Denis Kenzior
b12adda3c6 TODO: Set owner of use disconnect to abort connect 2016-07-18 11:27:06 -05:00
Denis Kenzior
a026e19947 TODO: Remove redundant tasks
Parsing of Authentication / Association management frames is not needed
since we are now using NL80211_CMD_CONNECT which combines authentication
and association into one step.

It might still be desirable to parse out authentication / association
result codes, if the result code provided in the CMD_CONNECT callback is
insufficient.
2016-07-18 11:24:07 -05:00
Rahul Rahul
6be18cff4e autotests: notify tests after registerAgent() 2016-07-18 11:19:10 -05:00
Andrew Zaborowski
fc0fd49cbd device: Emit property changed signals for Name 2016-07-14 19:00:36 -05:00
Andrew Zaborowski
940f4fce46 netdev: Track interface name changes 2016-07-14 19:00:14 -05:00
Andrew Zaborowski
6fbc9d59cc device: Unregister netdev watch in device_free 2016-07-14 18:58:24 -05:00
Andrew Zaborowski
07f177ca24 test: use GetOrderedNetworks() in list-devices 2016-07-14 10:04:18 -05:00
Andrew Zaborowski
d371c287bb test: Add a KnownNetworks test script 2016-07-14 10:04:04 -05:00
Andrew Zaborowski
d08874f842 wsc: Remove WSC dbus interface when device disappears
Previously device.c would remove the whole object at the path of the
Device and the WSC interfaces but now the watches are called without the
whole object appearing and disappearing.
2016-07-14 09:56:40 -05:00
Andrew Zaborowski
19fa024bd8 netdev: Reset interface state on init and exit
Take any managed interface down when iwd detects it and bring it back
up to start with a clean state.  On exit take interfaces down.
2016-07-13 12:36:35 -05:00
Andrew Zaborowski
2e845b5ee2 wiphy: Powered property setter 2016-07-13 12:33:30 -05:00
Andrew Zaborowski
bafafbf080 wiphy: Add a read-only Powered property 2016-07-13 10:34:23 -05:00
Andrew Zaborowski
c26b0ad3db autotest: Simplify iterating over network objects
Where the code just needs to find all of the network objects, don't look
for the device objects first because this only adds overhead.  With
the structure now having three levels it can be even more confusing,
especially in getCurrentlyConnectedNetworkName where the outer loop
didn't check for the Device interface.

In getNetworkList don't return after the first device's networks are
listed.
2016-07-13 10:33:34 -05:00
Andrew Zaborowski
4ebdf4e2ca wiphy: Add Adapter objects above Device
Change the path for net.connman.iwd.Device objects to /phyX/Y and
register net.connman.iwd.Adapter at /phyX grouping devices of the same
wiphy.

Turns out no changes to the test/* scripts are needed.
2016-07-13 10:32:49 -05:00
Andrew Zaborowski
28fc8e613d device: Add a Scanning property
The boolean property indicates if a scan is ongoing.  Only the scans
triggered by device.c are reflected (not the ones from WSC) because only
those scans affect the list of networks seen by Dbus.
2016-07-13 10:32:10 -05:00
Andrew Zaborowski
eac4b2fd0f device: Make Powered property writable 2016-07-13 10:31:31 -05:00
Andrew Zaborowski
6f51950f46 netdev: Add netdev_set_powered 2016-07-13 10:27:41 -05:00
Tim Kourt
9447801853 doc: Update t-runner docs
Update the instructions to use ell-key-crypto kernel branch
2016-07-13 10:25:02 -05:00
Tim Kourt
e7731f27ec tools: Update kernel config for t-r to use new opts 2016-07-13 10:24:42 -05:00