From accc6e309e9f9ce94ce34c7b2cdf60e16c78d1e1 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 26 Apr 2013 10:52:03 +0000 Subject: mac80211: update to wireless-testing 2013-04-16 + backports Signed-off-by: Felix Fietkau SVN-Revision: 36448 --- .../523-mac80211_configure_antenna_gain.patch | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'package/mac80211/patches/523-mac80211_configure_antenna_gain.patch') diff --git a/package/mac80211/patches/523-mac80211_configure_antenna_gain.patch b/package/mac80211/patches/523-mac80211_configure_antenna_gain.patch index 99bd2e3ba5..a3ba00dc46 100644 --- a/package/mac80211/patches/523-mac80211_configure_antenna_gain.patch +++ b/package/mac80211/patches/523-mac80211_configure_antenna_gain.patch @@ -1,14 +1,14 @@ --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -978,6 +978,7 @@ enum ieee80211_smps_mode { +@@ -988,6 +988,7 @@ enum ieee80211_smps_mode { * * @power_level: requested transmit power (in dBm), backward compatibility * value only that is set to the minimum of all interfaces + * @max_antenna_gain: maximum antenna gain adjusted by user config (in dBi) * - * @channel: the channel to tune to - * @channel_type: the channel (HT) type -@@ -1000,6 +1001,7 @@ struct ieee80211_conf { + * @chandef: the channel definition to tune to + * @radar_enabled: whether radar detection is enabled +@@ -1009,6 +1010,7 @@ struct ieee80211_conf { u32 flags; int power_level, dynamic_ps_timeout; int max_sleep_period; @@ -18,7 +18,7 @@ u8 ps_dtim_period; --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1116,6 +1116,7 @@ struct ieee80211_local { +@@ -1110,6 +1110,7 @@ struct ieee80211_local { int dynamic_ps_forced_timeout; int user_power_level; /* in dBm, for all interfaces */ @@ -28,9 +28,9 @@ --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -1654,6 +1654,8 @@ enum nl80211_attrs { - NL80211_ATTR_STA_CAPABILITY, - NL80211_ATTR_STA_EXT_CAPABILITY, +@@ -1709,6 +1709,8 @@ enum nl80211_attrs { + NL80211_ATTR_MDID, + NL80211_ATTR_IE_RIC, + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + @@ -39,15 +39,15 @@ __NL80211_ATTR_AFTER_LAST, --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -370,6 +370,7 @@ static const struct nla_policy nl80211_p - [NL80211_ATTR_MAC_ADDRS] = { .type = NLA_NESTED }, - [NL80211_ATTR_STA_CAPABILITY] = { .type = NLA_U16 }, - [NL80211_ATTR_STA_EXT_CAPABILITY] = { .type = NLA_BINARY, }, +@@ -378,6 +378,7 @@ static const struct nla_policy nl80211_p + [NL80211_ATTR_MDID] = { .type = NLA_U16 }, + [NL80211_ATTR_IE_RIC] = { .type = NLA_BINARY, + .len = IEEE80211_MAX_DATA_LEN }, + [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 }, }; /* policy for the key attributes */ -@@ -1706,6 +1707,22 @@ static int nl80211_set_wiphy(struct sk_b +@@ -1990,6 +1991,22 @@ static int nl80211_set_wiphy(struct sk_b goto bad_res; } @@ -72,7 +72,7 @@ u32 tx_ant, rx_ant; --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2212,6 +2212,19 @@ static int ieee80211_get_tx_power(struct +@@ -2269,6 +2269,19 @@ static int ieee80211_get_tx_power(struct return 0; } @@ -92,7 +92,7 @@ static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, const u8 *addr) { -@@ -3375,6 +3388,7 @@ struct cfg80211_ops mac80211_config_ops +@@ -3459,6 +3472,7 @@ struct cfg80211_ops mac80211_config_ops .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, @@ -102,7 +102,7 @@ CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -1862,6 +1862,7 @@ struct cfg80211_gtk_rekey_data { +@@ -1921,6 +1921,7 @@ struct cfg80211_update_ft_ies_params { * (as advertised by the nl80211 feature flag.) * @get_tx_power: store the current TX power into the dbm variable; * return 0 if successful @@ -110,7 +110,7 @@ * * @set_wds_peer: set the WDS peer for a WDS interface * -@@ -2071,6 +2072,7 @@ struct cfg80211_ops { +@@ -2134,6 +2135,7 @@ struct cfg80211_ops { enum nl80211_tx_power_setting type, int mbm); int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, int *dbm); @@ -122,20 +122,20 @@ +++ b/net/mac80211/main.c @@ -101,7 +101,7 @@ static u32 ieee80211_hw_conf_chan(struct struct ieee80211_sub_if_data *sdata; - struct ieee80211_channel *chan; + struct cfg80211_chan_def chandef = {}; u32 changed = 0; - int power; + int power, ant_gain, max_power; - enum nl80211_channel_type channel_type; u32 offchannel_flag; - bool scanning = false; -@@ -164,8 +164,21 @@ static u32 ieee80211_hw_conf_chan(struct + + offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; +@@ -165,8 +165,21 @@ static u32 ieee80211_hw_conf_chan(struct } rcu_read_unlock(); - if (local->hw.conf.power_level != power) { -+ max_power = chan->max_reg_power; -+ ant_gain = chan->max_antenna_gain; ++ max_power = chandef.chan->max_reg_power; ++ ant_gain = chandef.chan->max_antenna_gain; + if (local->user_antenna_gain > 0) { + if (local->user_antenna_gain > ant_gain) { + max_power -= local->user_antenna_gain - ant_gain; @@ -152,11 +152,11 @@ local->hw.cur_power_level = power; local->hw.conf.power_level = power; } -@@ -612,6 +625,7 @@ struct ieee80211_hw *ieee80211_alloc_hw( +@@ -597,6 +610,7 @@ struct ieee80211_hw *ieee80211_alloc_hw( IEEE80211_RADIOTAP_MCS_HAVE_BW; local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH; + local->user_antenna_gain = 0; + local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES; + local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN; local->user_power_level = IEEE80211_UNSET_POWER_LEVEL; - wiphy->ht_capa_mod_mask = &mac80211_ht_capa_mod_mask; - -- cgit v1.2.3