Skip to content

Commit c13ed53

Browse files
committed
Merge tag 'mac80211-next-for-davem-2016-09-16' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Johannes Berg says: ==================== This time we have various things - all across the board: * MU-MIMO sniffer support in mac80211 * a create_singlethread_workqueue() cleanup * interface dump filtering that was documented but not implemented * support for the new radiotap timestamp field * send delBA in two unexpected conditions (as required by the spec) * connect keys cleanups - allow only WEP with index 0-3 * per-station aggregation limit to work around broken APs * debugfs improvement for the integrated codel algorithm and various other small improvements and cleanups. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 22da734 + fbd05e4 commit c13ed53

34 files changed

+484
-277
lines changed

drivers/net/wireless/mac80211_hwsim.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ static const struct ieee80211_iface_combination hwsim_if_comb_p2p_dev[] = {
487487
};
488488

489489
static spinlock_t hwsim_radio_lock;
490-
static struct list_head hwsim_radios;
490+
static LIST_HEAD(hwsim_radios);
491491
static int hwsim_radio_idx;
492492

493493
static struct platform_driver mac80211_hwsim_driver = {
@@ -3376,7 +3376,6 @@ static int __init init_mac80211_hwsim(void)
33763376
mac80211_hwsim_unassign_vif_chanctx;
33773377

33783378
spin_lock_init(&hwsim_radio_lock);
3379-
INIT_LIST_HEAD(&hwsim_radios);
33803379

33813380
err = register_pernet_device(&hwsim_net_ops);
33823381
if (err)

include/net/cfg80211.h

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,7 +2432,8 @@ struct cfg80211_qos_map {
24322432
* cases, the result of roaming is indicated with a call to
24332433
* cfg80211_roamed() or cfg80211_roamed_bss().
24342434
* (invoked with the wireless_dev mutex held)
2435-
* @disconnect: Disconnect from the BSS/ESS.
2435+
* @disconnect: Disconnect from the BSS/ESS. Once done, call
2436+
* cfg80211_disconnected().
24362437
* (invoked with the wireless_dev mutex held)
24372438
*
24382439
* @join_ibss: Join the specified IBSS (or create if necessary). Once done, call
@@ -3954,6 +3955,34 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
39543955
unsigned int cfg80211_classify8021d(struct sk_buff *skb,
39553956
struct cfg80211_qos_map *qos_map);
39563957

3958+
/**
3959+
* cfg80211_find_ie_match - match information element and byte array in data
3960+
*
3961+
* @eid: element ID
3962+
* @ies: data consisting of IEs
3963+
* @len: length of data
3964+
* @match: byte array to match
3965+
* @match_len: number of bytes in the match array
3966+
* @match_offset: offset in the IE where the byte array should match.
3967+
* If match_len is zero, this must also be set to zero.
3968+
* Otherwise this must be set to 2 or more, because the first
3969+
* byte is the element id, which is already compared to eid, and
3970+
* the second byte is the IE length.
3971+
*
3972+
* Return: %NULL if the element ID could not be found or if
3973+
* the element is invalid (claims to be longer than the given
3974+
* data) or if the byte array doesn't match, or a pointer to the first
3975+
* byte of the requested element, that is the byte containing the
3976+
* element ID.
3977+
*
3978+
* Note: There are no checks on the element length other than
3979+
* having to fit into the given data and being large enough for the
3980+
* byte array to match.
3981+
*/
3982+
const u8 *cfg80211_find_ie_match(u8 eid, const u8 *ies, int len,
3983+
const u8 *match, int match_len,
3984+
int match_offset);
3985+
39573986
/**
39583987
* cfg80211_find_ie - find information element in data
39593988
*
@@ -3969,7 +3998,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb,
39693998
* Note: There are no checks on the element length other than
39703999
* having to fit into the given data.
39714000
*/
3972-
const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len);
4001+
static inline const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len)
4002+
{
4003+
return cfg80211_find_ie_match(eid, ies, len, NULL, 0, 0);
4004+
}
39734005

39744006
/**
39754007
* cfg80211_find_vendor_ie - find vendor specific information element in data

include/net/ieee80211_radiotap.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ struct ieee80211_radiotap_header {
190190
* IEEE80211_RADIOTAP_VHT u16, u8, u8, u8[4], u8, u8, u16
191191
*
192192
* Contains VHT information about this frame.
193+
*
194+
* IEEE80211_RADIOTAP_TIMESTAMP u64, u16, u8, u8 variable
195+
*
196+
* Contains timestamp information for this frame.
193197
*/
194198
enum ieee80211_radiotap_type {
195199
IEEE80211_RADIOTAP_TSFT = 0,
@@ -214,6 +218,7 @@ enum ieee80211_radiotap_type {
214218
IEEE80211_RADIOTAP_MCS = 19,
215219
IEEE80211_RADIOTAP_AMPDU_STATUS = 20,
216220
IEEE80211_RADIOTAP_VHT = 21,
221+
IEEE80211_RADIOTAP_TIMESTAMP = 22,
217222

218223
/* valid in every it_present bitmap, even vendor namespaces */
219224
IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
@@ -321,6 +326,22 @@ enum ieee80211_radiotap_type {
321326
#define IEEE80211_RADIOTAP_CODING_LDPC_USER2 0x04
322327
#define IEEE80211_RADIOTAP_CODING_LDPC_USER3 0x08
323328

329+
/* For IEEE80211_RADIOTAP_TIMESTAMP */
330+
#define IEEE80211_RADIOTAP_TIMESTAMP_UNIT_MASK 0x000F
331+
#define IEEE80211_RADIOTAP_TIMESTAMP_UNIT_MS 0x0000
332+
#define IEEE80211_RADIOTAP_TIMESTAMP_UNIT_US 0x0001
333+
#define IEEE80211_RADIOTAP_TIMESTAMP_UNIT_NS 0x0003
334+
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_MASK 0x00F0
335+
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_BEGIN_MDPU 0x0000
336+
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_MPDU 0x0010
337+
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_PPDU 0x0020
338+
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_PLCP_SIG_ACQ 0x0030
339+
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_UNKNOWN 0x00F0
340+
341+
#define IEEE80211_RADIOTAP_TIMESTAMP_FLAG_64BIT 0x00
342+
#define IEEE80211_RADIOTAP_TIMESTAMP_FLAG_32BIT 0x01
343+
#define IEEE80211_RADIOTAP_TIMESTAMP_FLAG_ACCURACY 0x02
344+
324345
/* helpers */
325346
static inline int ieee80211_get_radiotap_len(unsigned char *data)
326347
{

include/net/mac80211.h

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,6 +1735,9 @@ struct ieee80211_sta_rates {
17351735
* @supp_rates: Bitmap of supported rates (per band)
17361736
* @ht_cap: HT capabilities of this STA; restricted to our own capabilities
17371737
* @vht_cap: VHT capabilities of this STA; restricted to our own capabilities
1738+
* @max_rx_aggregation_subframes: maximal amount of frames in a single AMPDU
1739+
* that this station is allowed to transmit to us.
1740+
* Can be modified by driver.
17381741
* @wme: indicates whether the STA supports QoS/WME (if local devices does,
17391742
* otherwise always false)
17401743
* @drv_priv: data area for driver use, will always be aligned to
@@ -1775,6 +1778,7 @@ struct ieee80211_sta {
17751778
u16 aid;
17761779
struct ieee80211_sta_ht_cap ht_cap;
17771780
struct ieee80211_sta_vht_cap vht_cap;
1781+
u8 max_rx_aggregation_subframes;
17781782
bool wme;
17791783
u8 uapsd_queues;
17801784
u8 max_sp;
@@ -2014,6 +2018,11 @@ struct ieee80211_txq {
20142018
* @IEEE80211_HW_TX_FRAG_LIST: Hardware (or driver) supports sending frag_list
20152019
* skbs, needed for zero-copy software A-MSDU.
20162020
*
2021+
* @IEEE80211_HW_REPORTS_LOW_ACK: The driver (or firmware) reports low ack event
2022+
* by ieee80211_report_low_ack() based on its own algorithm. For such
2023+
* drivers, mac80211 packet loss mechanism will not be triggered and driver
2024+
* is completely depending on firmware event for station kickout.
2025+
*
20172026
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
20182027
*/
20192028
enum ieee80211_hw_flags {
@@ -2054,6 +2063,7 @@ enum ieee80211_hw_flags {
20542063
IEEE80211_HW_USES_RSS,
20552064
IEEE80211_HW_TX_AMSDU,
20562065
IEEE80211_HW_TX_FRAG_LIST,
2066+
IEEE80211_HW_REPORTS_LOW_ACK,
20572067

20582068
/* keep last, obviously */
20592069
NUM_IEEE80211_HW_FLAGS
@@ -2141,6 +2151,14 @@ enum ieee80211_hw_flags {
21412151
* the default is _GI | _BANDWIDTH.
21422152
* Use the %IEEE80211_RADIOTAP_VHT_KNOWN_* values.
21432153
*
2154+
* @radiotap_timestamp: Information for the radiotap timestamp field; if the
2155+
* 'units_pos' member is set to a non-negative value it must be set to
2156+
* a combination of a IEEE80211_RADIOTAP_TIMESTAMP_UNIT_* and a
2157+
* IEEE80211_RADIOTAP_TIMESTAMP_SPOS_* value, and then the timestamp
2158+
* field will be added and populated from the &struct ieee80211_rx_status
2159+
* device_timestamp. If the 'accuracy' member is non-negative, it's put
2160+
* into the accuracy radiotap field and the accuracy known flag is set.
2161+
*
21442162
* @netdev_features: netdev features to be set in each netdev created
21452163
* from this HW. Note that not all features are usable with mac80211,
21462164
* other features will be rejected during HW registration.
@@ -2184,6 +2202,10 @@ struct ieee80211_hw {
21842202
u8 offchannel_tx_hw_queue;
21852203
u8 radiotap_mcs_details;
21862204
u16 radiotap_vht_details;
2205+
struct {
2206+
int units_pos;
2207+
s16 accuracy;
2208+
} radiotap_timestamp;
21872209
netdev_features_t netdev_features;
21882210
u8 uapsd_queues;
21892211
u8 uapsd_max_sp_len;
@@ -3085,11 +3107,8 @@ enum ieee80211_reconfig_type {
30853107
*
30863108
* @sta_add_debugfs: Drivers can use this callback to add debugfs files
30873109
* when a station is added to mac80211's station list. This callback
3088-
* and @sta_remove_debugfs should be within a CONFIG_MAC80211_DEBUGFS
3089-
* conditional. This callback can sleep.
3090-
*
3091-
* @sta_remove_debugfs: Remove the debugfs files which were added using
3092-
* @sta_add_debugfs. This callback can sleep.
3110+
* should be within a CONFIG_MAC80211_DEBUGFS conditional. This
3111+
* callback can sleep.
30933112
*
30943113
* @sta_notify: Notifies low level driver about power state transition of an
30953114
* associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating
@@ -3485,10 +3504,6 @@ struct ieee80211_ops {
34853504
struct ieee80211_vif *vif,
34863505
struct ieee80211_sta *sta,
34873506
struct dentry *dir);
3488-
void (*sta_remove_debugfs)(struct ieee80211_hw *hw,
3489-
struct ieee80211_vif *vif,
3490-
struct ieee80211_sta *sta,
3491-
struct dentry *dir);
34923507
#endif
34933508
void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
34943509
enum sta_notify_cmd, struct ieee80211_sta *sta);

net/mac80211/agg-rx.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,13 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,
298298
buf_size = IEEE80211_MAX_AMPDU_BUF;
299299

300300
/* make sure the size doesn't exceed the maximum supported by the hw */
301-
if (buf_size > local->hw.max_rx_aggregation_subframes)
302-
buf_size = local->hw.max_rx_aggregation_subframes;
301+
if (buf_size > sta->sta.max_rx_aggregation_subframes)
302+
buf_size = sta->sta.max_rx_aggregation_subframes;
303303
params.buf_size = buf_size;
304304

305+
ht_dbg(sta->sdata, "AddBA Req buf_size=%d for %pM\n",
306+
buf_size, sta->sta.addr);
307+
305308
/* examine state machine */
306309
mutex_lock(&sta->ampdu_mlme.mtx);
307310

@@ -406,8 +409,10 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,
406409
}
407410

408411
end:
409-
if (status == WLAN_STATUS_SUCCESS)
412+
if (status == WLAN_STATUS_SUCCESS) {
410413
__set_bit(tid, sta->ampdu_mlme.agg_session_valid);
414+
__clear_bit(tid, sta->ampdu_mlme.unexpected_agg);
415+
}
411416
mutex_unlock(&sta->ampdu_mlme.mtx);
412417

413418
end_no_lock:

net/mac80211/cfg.c

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy,
3939

4040
if (type == NL80211_IFTYPE_MONITOR && flags) {
4141
sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
42-
sdata->u.mntr_flags = *flags;
42+
sdata->u.mntr.flags = *flags;
4343
}
4444

4545
return wdev;
@@ -73,8 +73,29 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
7373
sdata->u.mgd.use_4addr = params->use_4addr;
7474
}
7575

76-
if (sdata->vif.type == NL80211_IFTYPE_MONITOR && flags) {
76+
if (sdata->vif.type == NL80211_IFTYPE_MONITOR) {
7777
struct ieee80211_local *local = sdata->local;
78+
struct ieee80211_sub_if_data *monitor_sdata;
79+
u32 mu_mntr_cap_flag = NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER;
80+
81+
monitor_sdata = rtnl_dereference(local->monitor_sdata);
82+
if (monitor_sdata &&
83+
wiphy_ext_feature_isset(wiphy, mu_mntr_cap_flag)) {
84+
memcpy(monitor_sdata->vif.bss_conf.mu_group.membership,
85+
params->vht_mumimo_groups, WLAN_MEMBERSHIP_LEN);
86+
memcpy(monitor_sdata->vif.bss_conf.mu_group.position,
87+
params->vht_mumimo_groups + WLAN_MEMBERSHIP_LEN,
88+
WLAN_USER_POSITION_LEN);
89+
monitor_sdata->vif.mu_mimo_owner = true;
90+
ieee80211_bss_info_change_notify(monitor_sdata,
91+
BSS_CHANGED_MU_GROUPS);
92+
93+
ether_addr_copy(monitor_sdata->u.mntr.mu_follow_addr,
94+
params->macaddr);
95+
}
96+
97+
if (!flags)
98+
return 0;
7899

79100
if (ieee80211_sdata_running(sdata)) {
80101
u32 mask = MONITOR_FLAG_COOK_FRAMES |
@@ -89,11 +110,11 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
89110
* cooked_mntrs, monitor and all fif_* counters
90111
* reconfigure hardware
91112
*/
92-
if ((*flags & mask) != (sdata->u.mntr_flags & mask))
113+
if ((*flags & mask) != (sdata->u.mntr.flags & mask))
93114
return -EBUSY;
94115

95116
ieee80211_adjust_monitor_flags(sdata, -1);
96-
sdata->u.mntr_flags = *flags;
117+
sdata->u.mntr.flags = *flags;
97118
ieee80211_adjust_monitor_flags(sdata, 1);
98119

99120
ieee80211_configure_filter(local);
@@ -103,7 +124,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
103124
* and ieee80211_do_open take care of "everything"
104125
* mentioned in the comment above.
105126
*/
106-
sdata->u.mntr_flags = *flags;
127+
sdata->u.mntr.flags = *flags;
107128
}
108129
}
109130

@@ -2940,10 +2961,6 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
29402961
}
29412962

29422963
chanctx = container_of(conf, struct ieee80211_chanctx, conf);
2943-
if (!chanctx) {
2944-
err = -EBUSY;
2945-
goto out;
2946-
}
29472964

29482965
ch_switch.timestamp = 0;
29492966
ch_switch.device_timestamp = 0;

0 commit comments

Comments
 (0)