Commit graph

695 commits

Author SHA1 Message Date
Johannes Berg
3088e4e52d nl80211: Listen to unexpected 4addr events
Monitor-less AP mode had lost the ability to do
4addr WDS, this adds it back.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-06 19:32:41 +02:00
Johannes Berg
d6c9aab8d2 nl80211: Use global event socket for multicast events
This is a rewrite of Ben Greear's patch, making the
nl80211 code use just a single multicast event socket.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-06 19:30:43 +02:00
Johannes Berg
e32ad281ca nl80211: Register for Beacon frames in AP mode
When running AP mode, we need to receive beacons over overlapping BSSes
to handle protection. Use the new nl80211 command for this. As the
command works per wiphy (and we don't want to receive the Beacon frames
multiple times) add an abstraction that keeps track of per-wiphy data.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-06 18:39:57 +02:00
Johannes Berg
02bb32c393 nl80211: Subscribe to spurious class3 frame events
These events are necessary to send deauth frames to
stations sending spurious data frames. Subscribe to
them on the per-BSS event socket.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-06 18:29:45 +02:00
Johannes Berg
a11241fa11 nl80211: Use nl80211 for mgmt TX/RX in AP mode
To achieve this, multiple things are needed:
 1) since hostapd needs to handle *all* action frames,
    make the normal registration only when in a non-AP
    mode, to be able to do this use the new socket
 2) store the frequency in each BSS to be able to give
    the right frequency to nl80211's mgmt-tx operation
 3) make TX status processing reject non-matched cookie
    only in non-AP mode

The whole thing depends on having station-poll support
in the kernel. That's currently a good indicator since
the kernel patches are added together.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-06 18:24:00 +02:00
Jouni Malinen
8c3ba0784e nl80211: Use driver event to indicate failure on authentication retry
When using authentication retry within driver_nl80211.c, a failure on the
second attempt has to be indicated with a driver event since the return
code from wpa_driver_nl80211_authenticate() is not actually delivered to
the core code in that case.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-04 22:28:30 +02:00
Jouni Malinen
536fd62dba nl80211: Recover from auth req ENOENT with a scan
cfg80211 rejects NL80211_CMD_AUTHENTICATE with ENOENT if the BSS entry
for the target BSS is not available. This can happen if the cfg80211
entry has expired before wpa_supplicant entry (e.g., during a suspend).
To recover from this quickly, run a single channel scan to get the
cfg80211 entry back and then retry authentication command again. This
is handled within driver_nl80211.c to keep the core wpa_supplicant
implementation cleaner.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-04 21:53:56 +02:00
Johannes Berg
9f12614b8c nl80211: Do not encrypt IEEE 802.1X WEP EAPOL
Set the NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT flag for nl80211 to tell
drivers (mac80211) to not encrypt the EAPOL frames for WEP IEEE 802.1X.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-03 20:46:12 +02:00
Johannes Berg
cc7a48d1f4 nl80211: Allocate nl CB for BSS RX
In preparation for things that receive on a BSS-specific handle,
allocate a CB for it and hook it up to receive functions.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-03 20:14:53 +02:00
Johannes Berg
f06aedd92f nl80211: Rename process_event
The next patch will add process_bss_event, rename process_event to
process_drv_event to differentiate between them.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-03 20:10:44 +02:00
Johannes Berg
a4ae123c3f nl80211: Pass cb to eloop function
By passing the nl_cb as the context to the eloop function we can
(in the next patch) use the same eloop function for BSS events.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-03 20:07:54 +02:00
Johannes Berg
1afc986d84 nl80211: Use one CB for driver event RX
There's no need to clone the CB all the time
and then assign it, just use a constant one.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-03 20:00:11 +02:00
Johannes Berg
e4fb216769 nl80211: Store frequency in bss struct
Storing the frequency in the bss struct allows using it for frame
commands in AP mode and not relying on the driver struct as much, which
is good for hostapd mode.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-03 19:55:22 +02:00
Johannes Berg
3fd1cefb81 nl80211: Move AP SME setup to mode change
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-03 19:47:01 +02:00
Johannes Berg
32ab485503 nl80211: Use socket error queue for EAPOL TX status
This will allow getting TX status for EAPOL frames
sent as data frames if the driver supports it.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-03 19:32:23 +02:00
Jouni Malinen
aef85ba204 nl80211: Ignore interface up event if interface is down
The RTM_NEWLINK even can have IFF_UP flag even if the interface is
down. Do not generate EVENT_INTERFACE_ENABLED event based on such a
message.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-03 13:18:57 +02:00
Jouni Malinen
3b1c7bfdc5 nl80211: Use binary hexdump for scan IEs instead of text
The IEs are binary data, so there is not much point in trying
to show them as ASCII data in debug prints.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-03 12:47:34 +02:00
Jouni Malinen
e5693c4775 Merge set_rate_sets() driver_ops into set_ap()
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-03 12:16:03 +02:00
Jouni Malinen
5f17b3ee9f Remove unused parameters from set_rate_sets()
Only setting of the basic rate set was supported, so remove the
unused parameters.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-03 11:57:13 +02:00
Jouni Malinen
d03e8d118c nl80211: Merge ap_isolate configuration into nl80211_set_bss()
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-03 11:43:18 +02:00
Jouni Malinen
e53a0c7406 Fix a typo in a comment
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-03 11:38:51 +02:00
Dmitry Shmidt
216eede830 Android: nl80211: Add Android specific PNO configuration
This is based on the Android driver_cmd changes that are converted to
use the sched_scan/stop_sched_scan driver_ops for the case where the
driver does not support the new nl80211 commands.

Change-Id: Iaedc340f84650af422bd2ea57d2a8b0a9d4a5330
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-11-29 15:18:52 +02:00
Dmitry Shmidt
5eb429101a Android: wext: Add sched_scan functions for PNO
(jm: This is based on the Android change that used driver_cmd. The same
implementation is used for the actual driver interface, but the commands
are now accessed through sched_scan/stop_sched_scan driver_ops instead
of driver_cmd)
2011-11-29 15:18:45 +02:00
Dmitry Shmidt
06e356fe14 Android: wext: Add driver state events 2011-11-29 15:18:21 +02:00
Jouni Malinen
527a398866 wext: Define some new values if linux/wireless.h is too old
IW_ENCODE_ALG_PMK and IW_ENC_CAPA_4WAY_HANDSHAKE are not defined in the
Android tree, so add compatibility defines for these.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-25 23:56:15 +02:00
Jouni Malinen
fb67eec6f8 nl80211: Do not set sched_scan filter if driver does not support it
cfg80211 will reject the NL80211_CMD_START_SCHED_SCAN if too many
match sets are requested. To avoid being completely unable to start
any scheduled scans, skip setting these filters if the driver did
not advertise support for large enough number of match sets.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-25 17:46:00 +02:00
Jouni Malinen
29f338af26 nl80211: Implement set_p2p_powersave for legacy_ps changes
This adds initial implementation of set_p2p_powersave to allow legacy PS
mode to be configured. P2P PS parameters are not yet supported.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-25 13:11:22 +02:00
Johannes Berg
88df0ef74f nl80211: Set offchannel-OK selectively
It's not really valid to send off-channel in all cases,
so pass whether it should be allowed or not and don't
set it in the AP case.

Also, to get the right ifindex for hostapd, pass a bss
pointer instead of the drv pointer.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-11-19 19:56:34 +02:00
Johannes Berg
221a59c9b6 nl80211: Move preq NL handle into BSS
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-11-19 19:48:49 +02:00
Jouni Malinen
ddc5327139 nl80211: Add no_ack support for NL80211_CMD_FRAME
This is needed to allow no-ACK operation with Probe Response frames
in P2P Listen state.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-19 19:32:05 +02:00
Helmut Schaa
fab2533604 nl80211: Implement noack policy for send_mlme
Signed-hostap: Helmut Schaa <helmut.schaa@googlemail.com>
2011-11-19 19:22:13 +02:00
Helmut Schaa
8cfa3527e1 Allow MLME frames to be sent without expecting an ACK (no retries)
In some situations it might be benefical to send a unicast frame without
the need for getting it ACKed (probe responses for example). In order to
achieve this add a new noack parameter to the drivers send_mlme callback
that can be used to advise the driver to not wait for an ACK for this
frame.

Signed-hostap: Helmut Schaa <helmut.schaa@googlemail.com>
2011-11-19 19:02:05 +02:00
Johannes Berg
397188521d nl80211: Support in-kernel station poll
If the kernel supports this, don't use manual null
data frame transmissions. This is one thing to get
rid of cooked monitor interfaces.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-11-19 14:23:46 +02:00
Johannes Berg
d12dab4c6f nl80211: Use non-receiving socket for EAPOL TX
The non-monitor TX currently uses a normal L2 abstraction
socket, but that will also receive frames we don't want,
so use a plain socket that isn't bound for RX. This might
be possible using the L2 abstraction, but we need a plain
socket later for getting TX status events here.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-11-19 14:00:53 +02:00
Johannes Berg
61cbe2ffd8 nl80211: Use device AP SME capability
This changes the auto-detection of whether or not the device contains
the AP SME away from monitor interface addition failing to the explicit
attribute in nl80211. Keep the old auto-detection for a little while so
that ath6kl isn't broken right away.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-11-19 13:42:49 +02:00
Jouni Malinen
7a5257bbc9 nl80211: Sync with wireless-testing.git linux/nl80211.h
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-19 13:40:07 +02:00
Johannes Berg
dd840f793c AP: Add explicit EAPOL TX status event
The new event can be used when EAPOL TX status can't be reported as a
complete 802.11 frame but is instead reported as just the EAPOL data as
originally passed to hapd_send_eapol().

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-11-19 13:00:30 +02:00
Jithu Jance
57ebba598d nl80211: Implement shared_freq
This patch implements shared_freq handler for driver_nl80211.c. If a
"p2p_group_add" happens after legacy STA association, then this patch
will help to start the GO on the same frequency. This is useful when
supplicant is started on multiple interface running over a singly "PHY"
and the station interface is not used for the P2P device operations.

For example, wpa_supplicant -iwlan0 ..  -N -iwlan1 ... and wlan0 is used
for station connection and wlan1 as the P2P device interface.

Signed-hostap: Jithu Jance <jithu@broadcom.com>
2011-11-19 11:23:49 +02:00
Ben Greear
3b7ea88047 nl80211: Make MLME failure messages unique
Without this, it is impossible to tell exactly which
MLME code returned the error.

Also, convert to wpa_dbg so that we get device names
in the messages.

Signed-hostap: Ben Greear <greearb@candelatech.com>
2011-11-18 23:41:52 +02:00
Dan Williams
98ac6763ff nl80211: Fix UNSPEC signal quality reporting
r->level got assigned so it's clearly not INVALID; instead
r->qual should be invalid.

Signed-hostap: Dan Williams <dcbw@redhat.com>
2011-11-18 23:23:45 +02:00
Johannes Berg
335d42b1a6 nl80211: Get rid of family/cache objects
All we really need is the family ID, and we can
get that with genl_ctrl_resolve() and then don't
need to worry about family/cache objects.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-11-16 16:42:49 +02:00
Jouni Malinen
545cfc4bf3 WEXT: Use linux/wireless.h instead of wireless_copy.h
WEXT is not really changing anymore and more or less all Linux
distros come with linux/wireless.h that is recent enough to
allow the driver wrappers to be build.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-15 20:03:00 +02:00
Jouni Malinen
a5c696adb4 nl80211: Verify that global driver pointer is not NULL
driver_nl80211.c assumes that global driver pointer is set, so better
make this more consistent.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-13 22:39:57 +02:00
Jouni Malinen
9d77a392c7 Use a pre-processor macro to simplify event_to_string()
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-13 19:06:37 +02:00
Ben Greear
6c3771d7d5 Print human readable driver event names
This makes it easier to understand the event related logs.

Signed-hostap: Ben Greear <greearb@candelatech.com>
2011-11-13 19:01:38 +02:00
Jouni Malinen
aea855d752 Move wpa_scan_results_free() into shared C file
Replace the inline helper function with a new C file that can be used
for common driver API related function.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-13 18:56:26 +02:00
Jouni Malinen
b6c8df695c Remove station functionality from hostap and madwifi driver wrappers
This has been obsoleted by the more generic Linux WEXT (driver_wext.c)
support. The hostap and madwifi driver wrappers can now be used only
with hostapd. The old station interface remains available in releases up
to 1.x.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-13 11:14:44 +02:00
Jouni Malinen
3962b65858 Remove unmaintained driver wrappers
The driver wrappers broadcom, iphone, osx, and ralink have not been
maintained for a while and it does not look like they will be in the
future either. As such, remove them from the development branch. The
previous versions will be included in older releases up to 1.x.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-13 10:57:46 +02:00
Jouni Malinen
39e7d718f6 ndis: Work around lack of C99 designated initializers in MSVC
Use a driver_ndis.c specific initialization function to fill in the
wpa_driver_ops information to make it easier to modify struct
wpa_driver_ops in the future. Being able to build driver_ndis.c
with MSVC was the only reason for having to maintain the same order
of function pointers in struct wpa_driver_ops and for having to
update driver_ndis.c for all changes in that structure.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-03 18:45:21 +02:00
Gary Morain
577db0aedd Prefer 5 GHz networks over 2.4 GHz networks
In scan.c, merge a channel's noise value into the scan results. When
comparing scan results, compute the signal-to-noise ratio and use it
when available. Prefer a 5 GHz network if its SNR is really big (> 30)
or if its SNR is relatively close to the other network's.
2011-10-30 21:08:21 +02:00