mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts: net/nfc/netlink.c Signed-off-by: John W. Linville <[email protected]>
This commit is contained in:
commit
c487606f83
148 changed files with 3919 additions and 3413 deletions
|
|
@ -612,6 +612,17 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp)
|
|||
}
|
||||
EXPORT_SYMBOL(cfg80211_del_sta);
|
||||
|
||||
void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
|
||||
enum nl80211_connect_failed_reason reason,
|
||||
gfp_t gfp)
|
||||
{
|
||||
struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
|
||||
|
||||
nl80211_send_conn_failed_event(rdev, dev, mac_addr, reason, gfp);
|
||||
}
|
||||
EXPORT_SYMBOL(cfg80211_conn_failed);
|
||||
|
||||
struct cfg80211_mgmt_registration {
|
||||
struct list_head list;
|
||||
|
||||
|
|
|
|||
|
|
@ -8364,6 +8364,40 @@ void nl80211_send_sta_del_event(struct cfg80211_registered_device *rdev,
|
|||
nlmsg_free(msg);
|
||||
}
|
||||
|
||||
void nl80211_send_conn_failed_event(struct cfg80211_registered_device *rdev,
|
||||
struct net_device *dev, const u8 *mac_addr,
|
||||
enum nl80211_connect_failed_reason reason,
|
||||
gfp_t gfp)
|
||||
{
|
||||
struct sk_buff *msg;
|
||||
void *hdr;
|
||||
|
||||
msg = nlmsg_new(NLMSG_GOODSIZE, gfp);
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_CONN_FAILED);
|
||||
if (!hdr) {
|
||||
nlmsg_free(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) ||
|
||||
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) ||
|
||||
nla_put_u32(msg, NL80211_ATTR_CONN_FAILED_REASON, reason))
|
||||
goto nla_put_failure;
|
||||
|
||||
genlmsg_end(msg, hdr);
|
||||
|
||||
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
||||
nl80211_mlme_mcgrp.id, gfp);
|
||||
return;
|
||||
|
||||
nla_put_failure:
|
||||
genlmsg_cancel(msg, hdr);
|
||||
nlmsg_free(msg);
|
||||
}
|
||||
|
||||
static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd,
|
||||
const u8 *addr, gfp_t gfp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -91,6 +91,11 @@ void nl80211_send_sta_del_event(struct cfg80211_registered_device *rdev,
|
|||
struct net_device *dev, const u8 *mac_addr,
|
||||
gfp_t gfp);
|
||||
|
||||
void nl80211_send_conn_failed_event(struct cfg80211_registered_device *rdev,
|
||||
struct net_device *dev, const u8 *mac_addr,
|
||||
enum nl80211_connect_failed_reason reason,
|
||||
gfp_t gfp);
|
||||
|
||||
int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
|
||||
struct wireless_dev *wdev, u32 nlpid,
|
||||
int freq, int sig_dbm,
|
||||
|
|
|
|||
|
|
@ -504,9 +504,11 @@ static bool reg_does_bw_fit(const struct ieee80211_freq_range *freq_range,
|
|||
*
|
||||
* This lets us know if a specific frequency rule is or is not relevant to
|
||||
* a specific frequency's band. Bands are device specific and artificial
|
||||
* definitions (the "2.4 GHz band" and the "5 GHz band"), however it is
|
||||
* safe for now to assume that a frequency rule should not be part of a
|
||||
* frequency's band if the start freq or end freq are off by more than 2 GHz.
|
||||
* definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"),
|
||||
* however it is safe for now to assume that a frequency rule should not be
|
||||
* part of a frequency's band if the start freq or end freq are off by more
|
||||
* than 2 GHz for the 2.4 and 5 GHz bands, and by more than 10 GHz for the
|
||||
* 60 GHz band.
|
||||
* This resolution can be lowered and should be considered as we add
|
||||
* regulatory rule support for other "bands".
|
||||
**/
|
||||
|
|
@ -514,9 +516,16 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range,
|
|||
u32 freq_khz)
|
||||
{
|
||||
#define ONE_GHZ_IN_KHZ 1000000
|
||||
if (abs(freq_khz - freq_range->start_freq_khz) <= (2 * ONE_GHZ_IN_KHZ))
|
||||
/*
|
||||
* From 802.11ad: directional multi-gigabit (DMG):
|
||||
* Pertaining to operation in a frequency band containing a channel
|
||||
* with the Channel starting frequency above 45 GHz.
|
||||
*/
|
||||
u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ?
|
||||
10 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ;
|
||||
if (abs(freq_khz - freq_range->start_freq_khz) <= limit)
|
||||
return true;
|
||||
if (abs(freq_khz - freq_range->end_freq_khz) <= (2 * ONE_GHZ_IN_KHZ))
|
||||
if (abs(freq_khz - freq_range->end_freq_khz) <= limit)
|
||||
return true;
|
||||
return false;
|
||||
#undef ONE_GHZ_IN_KHZ
|
||||
|
|
@ -2193,7 +2202,6 @@ static void print_regdomain_info(const struct ieee80211_regdomain *rd)
|
|||
static int __set_regdom(const struct ieee80211_regdomain *rd)
|
||||
{
|
||||
const struct ieee80211_regdomain *intersected_rd = NULL;
|
||||
struct cfg80211_registered_device *rdev = NULL;
|
||||
struct wiphy *request_wiphy;
|
||||
/* Some basic sanity checks first */
|
||||
|
||||
|
|
@ -2305,24 +2313,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!intersected_rd)
|
||||
return -EINVAL;
|
||||
|
||||
rdev = wiphy_to_dev(request_wiphy);
|
||||
|
||||
rdev->country_ie_alpha2[0] = rd->alpha2[0];
|
||||
rdev->country_ie_alpha2[1] = rd->alpha2[1];
|
||||
rdev->env = last_request->country_ie_env;
|
||||
|
||||
BUG_ON(intersected_rd == rd);
|
||||
|
||||
kfree(rd);
|
||||
rd = NULL;
|
||||
|
||||
reset_regdomains(false);
|
||||
cfg80211_regdomain = intersected_rd;
|
||||
|
||||
return 0;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue