Commit Graph

66 Commits

Author SHA1 Message Date
Denis Kenzior d85e6eedff manager: Don't try to create pending_state more than once 2019-04-16 17:51:00 -05:00
Andrew Zaborowski 467b6341d8 manager: Handle interface white/blacklists
Mirror netdev.c white/blacklist logic.  If either or both the whitelist
and the blacklist are given also fall back to not touching the existing
interface setup on the wiphy.
2019-04-16 17:51:00 -05:00
Andrew Zaborowski 9e079ba4fc manager: Fallback to old logic for some drivers
If we get an error during DEL_INTERFACE or NEW_INTERFACE we may be
dealing with a driver that doesn't implement virtual interfaces or
doesn't implement deleting the default interface.  In this case fall
back to using the first usable interface that we've detected on this
wiphy.

There's at least one full-mac driver that doesn't implement the cfg80211
.del_virtual_intf and .add_virtual_intf methods and at least one that
only allows P2P interfaces to be manipulated.  mac80211 drivers seem to
at least implement those methods but I didn't check to see if there are
driver where they'd eventually return EOPNOTSUPP.
2019-04-16 17:51:00 -05:00
Andrew Zaborowski d907593c08 manager: Create an interface on each wiphy and register netdevs
This is probably the trickiest part in this patchset.  I'm introducing a
new logic where instead of using the interfaces that we find present
when a wiphy is detected, which would normally be the one default
interface per wiphy but could be 0 or more than one, we create one
ourselves with the socket owner attribute and use exactly one for
Station, AP and Ad-Hoc modes.  When IWD starts we delete all the
interfaces on existing wiphys that we're going to use (as determined by
the wiphy white/blacklists) or freshly hotplugged ones, and only then we
register the interface we're going to use meaning that the wiphy's
limits on the number of concurrent interfaces of each type should be at
0.  Otherwise we'd be unlikely to be abe to create the station interface
as most adapters only allow one.  After that we ignore any interfaces
that may be created by other processes as we have no use for multiple
station interfaces.

At this point manager.c only keeps local state for wiphys during
the interface setup although when we start adding P2P code we will be
creating and removing interfaces multiple times during the wiphy's
runtime and may need to track it here or in wiphy.c.  We do not
specifically check the interface number limits received during the wiphy
dump, if we need to create any interfaces and we're over the driver's
maximum for that specific iftype we'll still attempt it and report error
if it fails.

I tested this and it seems to work with my laptop's intel card and some
USB hotplug adapters.
2019-04-16 17:51:00 -05:00
Denis Kenzior 5a28504d9e manager: Simplify logic 2019-04-11 12:09:07 -05:00
Andrew Zaborowski 530a449337 manager: Add new file for wiphy/interface management
Add manager.c, a new file where the wiphy and interface creation/removal
will be handled and interface use policies will be implemented.  Since
not all kernel-side nl80211 interfaces are tied to kernel-side netdevs,
netdev.c can't manage all of the interfaces that we will be using, so
the logic is being moved to a common place where all interfaces on a
wiphy will be managed according to the policy, device support for things
like P2P and user enabling/disabling/connecting with P2P which require
interfaces to be dynamically added and removed.
2019-04-11 11:17:52 -05:00
Andrew Zaborowski 15bab067fc dbus: Remove Manager interface, add AgentManager
Move the Agent-related methods to a new interface, AgentManager, and
drop the remaining methods and signals made redundant by the
ObjectManager.
2016-05-23 11:46:59 -05:00
Denis Kenzior 3ca8dfb5ad wiphy: move & rename iwd_device_get_path
Move declaration to device.h and rename to device_get_path
2016-05-12 09:49:07 -05:00
Denis Kenzior e2de4423db dbus: Update to the new ell D-Bus APIs 2016-02-11 16:19:55 -06:00
Jukka Rissanen e17d2d63c2 agent: Make sure Release is sent when iwd exits
The main loop cannot be quit in signal handler as that would
prevent the agent.c from sending the Release command to the agent.
2015-03-02 20:59:01 -06:00
Jukka Rissanen 5c4a2cf61a manager: Initialize the agent dbus interface 2015-02-27 10:42:58 -06:00
Denis Kenzior 3cf47d4109 manager: Add missing signals to introspection 2014-11-03 15:24:12 -06:00
Denis Kenzior 77255dbee0 manager: Implement GetDevices method 2014-10-23 22:41:45 -05:00
Denis Kenzior ae95cbd172 dbus: Use a #define for IWD_MANAGER_PATH 2014-10-23 15:07:08 -05:00
Denis Kenzior 6437e5ae92 dbus: Move Manager Interface #define to dbus.h 2014-10-23 14:34:13 -05:00
Denis Kenzior 09c29ba3e2 manager: Add manager skeleton 2014-10-06 22:13:40 -05:00