Revert "nl80211: Add probe response offload attribute"

This reverts commit ad8daec8b4baab017c4d67d6c978a5285af6a68f.
Revert "nl80211: advertise device AP SME"

This reverts commit d226d76fe5694eae15de3590a6182da89c75757a.
Revert "net/wireless: Check for number of sub bands"

This reverts commit dbb62d078e40c3840d3f74ce377d29d7b9b5c0fc.
Revert "net/wireless: Support to disable CCK rate for management frame"

This reverts commit c1a69447b562c3e23ec4eb50258a00ff7d231562.
Revert "cfg80211: Validate cipher suite against supported ciphers"

This reverts commit 3a930f4358233cc0d52c20507fff79d44d7bb002.
Revert "cfg80211: Remove strict validation of AKM suites"

This reverts commit fd4c84a49e61c508c0e6bfe9dd4407241e7d545a.
Revert "nl80211: Change the sequence of NL attributes."

This reverts commit ce65e812f238e376de569d18fbd1a142a82abee3.
Revert "nl80211/cfg80211: Add crypto settings into NEW_BEACON"

This reverts commit 6f79e1678d95df8a61cdf4c55cad0f74f587c85f.
Revert "cfg80211/nl80211: Send AssocReq IEs to user space in AP mode"

This reverts commit 7ad229d902e9c628194c848ca0cb890ab3e94813.
Revert Sony changes for BCM4330

Change-Id: Id9c1b7da9a3cccf33f415f56ec853e2e5e370d68
Revert "msm: nl80211: Add WAPI support for cfg80211."

This reverts commit 5b26a95110742e32ea8ec0dc57f7d5c1fa5734bf.
nl80211: fix HT capability attribute validation

commit 6c7394197af90f6a332180e33f5d025d3037d883 upstream.

Since the NL80211_ATTR_HT_CAPABILITY attribute is
used as a struct, it needs a minimum, not maximum
length. Enforce that properly. Not doing so could
potentially lead to reading after the buffer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
msm: nl80211: Add WAPI support for cfg80211.

This provides WAPI support for cfg80211.

Change-Id: I6ec1f6804cd9017bd332b4dd5ab06f18b390e120
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
nl80211: fix MAC address validation

commit e007b857e88097c96c45620bf3b04a4e309053d1 upstream.

MAC addresses have a fixed length. The current
policy allows passing < ETH_ALEN bytes, which
might result in reading beyond the buffer.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
cfg80211/nl80211: Send AssocReq IEs to user space in AP mode

When user space SME/MLME (e.g., hostapd) is not used in AP mode, the
IEs from the (Re)Association Request frame that was processed in
firmware need to be made available for user space (e.g., RSN IE for
hostapd). Allow this to be done with cfg80211_new_sta().

Add a comment pointing out the use of enum station_info_flags for
all new struct station_info fields. In addition, memset the sinfo
buffer to zero before use on all paths in the current tree to avoid
leaving uninitialized pointers in the data.

Change-Id: Ia2220d58ee81c1b7ca905cfc8eb55b6a84779d38
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
nl80211/cfg80211: Add crypto settings into NEW_BEACON

This removes need from drivers to parse the beacon tail/head data
to figure out what crypto settings are to be used in AP mode in case
the Beacon and Probe Response frames are fully constructed in the
driver/firmware.

nl80211/cfg80211: Allow SSID to be specified in new beacon command

This makes it easier for drivers that generate Beacon and Probe Response
frames internally (in firmware most likely) in AP mode.

nl80211/cfg80211: Add extra IE configuration to AP mode setup

The NL80211_CMD_NEW_BEACON command is, in practice, requesting AP mode
operations to be started. Add new attributes to provide extra IEs
(e.g., WPS IE, P2P IE) for drivers that build Beacon, Probe Response,
and (Re)Association Response frames internally (likely in firmware).

Change-Id: Ib91cd3fa2bad68e3724db98985e3f3bac72715f0
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
cfg80211: Remove strict validation of AKM suites

NL80211_ATTR_AKM_SUITES can be used to configure new AKMs, like FT or
the SHA-256 -based AKMs or FT from 802.11r/802.11w. In addition, vendor
specific AKMs could be used. The current validation code for the connect
command prevents cfg80211-based drivers from using these mechanisms even
if the driver would not actually use this AKM value (i.e., it uses
WPA/RSN IE from user space). mac80211-based drivers allow any AKM to be
used since this value is not used there.

Remove the unnecessary validation step in cfg80211 to allow drivers to
decide what AKMs are supported. In theory, we could handle this by
advertising supported AKMs, but that would not be very effective unless
we enforce all drivers (including mac80211) to advertise the set of
supported AKMs. This would require additional changes in many places
whenever a new AKM is introduced even though no actually functionality
changes may be required in most drivers.

Signed-off-by: Jack Cheung <jackc@codeaurora.org>
(cherry picked from commit 7878aa18cbb59ac95b7c260fbc2f6edb85a61304)

Change-Id: I8da9f2b282b70d28dccc9f828a018447c325356c
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
cfg80211: Validate cipher suite against supported ciphers

Instead of using a hardcoded list of cipher suites in nl80211.c, use a
shared function in util.c to verify that the driver advertises support
for the specified cipher. This provides more accurate validation of the
values and allows vendor-specific cipher suites to be added in drivers.

Signed-off-by: Jack Cheung <jackc@codeaurora.org>
(cherry picked from commit 976d06b486373ade56494e7ad41660e5db24f6bf)

Change-Id: I8d1494892cc6c3528b5aeae01d5e526602d72d8f
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
cfg80211: fix a crash in nl80211_send_station

mac80211 leaves sinfo->assoc_req_ies uninitialized, causing a random
pointer memory access in nl80211_send_station.
Instead of checking if the pointer is null, use sinfo->filled, like
the rest of the fields.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
nl80211: Change the sequence of NL attributes.

change sequence of kernel NL attributes which align hostap NL
attributes sequence so it will copy probe response IE's properly
and pass it to the driver.

Change-Id: I6c3b46b99f2537c4ea0335135f21416c81797af4
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>