Skip to content

Commit

Permalink
Merge tag 'mac80211-next-for-davem-2016-09-16' of git://git.kernel.or…
Browse files Browse the repository at this point in the history
…g/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>
  • Loading branch information
David S. Miller committed Sep 19, 2016
2 parents 22da734 + fbd05e4 commit c13ed53
Show file tree
Hide file tree
Showing 34 changed files with 484 additions and 277 deletions.
3 changes: 1 addition & 2 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ static const struct ieee80211_iface_combination hwsim_if_comb_p2p_dev[] = {
};

static spinlock_t hwsim_radio_lock;
static struct list_head hwsim_radios;
static LIST_HEAD(hwsim_radios);
static int hwsim_radio_idx;

static struct platform_driver mac80211_hwsim_driver = {
Expand Down Expand Up @@ -3376,7 +3376,6 @@ static int __init init_mac80211_hwsim(void)
mac80211_hwsim_unassign_vif_chanctx;

spin_lock_init(&hwsim_radio_lock);
INIT_LIST_HEAD(&hwsim_radios);

err = register_pernet_device(&hwsim_net_ops);
if (err)
Expand Down
36 changes: 34 additions & 2 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2432,7 +2432,8 @@ struct cfg80211_qos_map {
* cases, the result of roaming is indicated with a call to
* cfg80211_roamed() or cfg80211_roamed_bss().
* (invoked with the wireless_dev mutex held)
* @disconnect: Disconnect from the BSS/ESS.
* @disconnect: Disconnect from the BSS/ESS. Once done, call
* cfg80211_disconnected().
* (invoked with the wireless_dev mutex held)
*
* @join_ibss: Join the specified IBSS (or create if necessary). Once done, call
Expand Down Expand Up @@ -3954,6 +3955,34 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
unsigned int cfg80211_classify8021d(struct sk_buff *skb,
struct cfg80211_qos_map *qos_map);

/**
* cfg80211_find_ie_match - match information element and byte array in data
*
* @eid: element ID
* @ies: data consisting of IEs
* @len: length of data
* @match: byte array to match
* @match_len: number of bytes in the match array
* @match_offset: offset in the IE where the byte array should match.
* If match_len is zero, this must also be set to zero.
* Otherwise this must be set to 2 or more, because the first
* byte is the element id, which is already compared to eid, and
* the second byte is the IE length.
*
* Return: %NULL if the element ID could not be found or if
* the element is invalid (claims to be longer than the given
* data) or if the byte array doesn't match, or a pointer to the first
* byte of the requested element, that is the byte containing the
* element ID.
*
* Note: There are no checks on the element length other than
* having to fit into the given data and being large enough for the
* byte array to match.
*/
const u8 *cfg80211_find_ie_match(u8 eid, const u8 *ies, int len,
const u8 *match, int match_len,
int match_offset);

/**
* cfg80211_find_ie - find information element in data
*
Expand All @@ -3969,7 +3998,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb,
* Note: There are no checks on the element length other than
* having to fit into the given data.
*/
const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len);
static inline const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len)
{
return cfg80211_find_ie_match(eid, ies, len, NULL, 0, 0);
}

/**
* cfg80211_find_vendor_ie - find vendor specific information element in data
Expand Down
21 changes: 21 additions & 0 deletions include/net/ieee80211_radiotap.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ struct ieee80211_radiotap_header {
* IEEE80211_RADIOTAP_VHT u16, u8, u8, u8[4], u8, u8, u16
*
* Contains VHT information about this frame.
*
* IEEE80211_RADIOTAP_TIMESTAMP u64, u16, u8, u8 variable
*
* Contains timestamp information for this frame.
*/
enum ieee80211_radiotap_type {
IEEE80211_RADIOTAP_TSFT = 0,
Expand All @@ -214,6 +218,7 @@ enum ieee80211_radiotap_type {
IEEE80211_RADIOTAP_MCS = 19,
IEEE80211_RADIOTAP_AMPDU_STATUS = 20,
IEEE80211_RADIOTAP_VHT = 21,
IEEE80211_RADIOTAP_TIMESTAMP = 22,

/* valid in every it_present bitmap, even vendor namespaces */
IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
Expand Down Expand Up @@ -321,6 +326,22 @@ enum ieee80211_radiotap_type {
#define IEEE80211_RADIOTAP_CODING_LDPC_USER2 0x04
#define IEEE80211_RADIOTAP_CODING_LDPC_USER3 0x08

/* For IEEE80211_RADIOTAP_TIMESTAMP */
#define IEEE80211_RADIOTAP_TIMESTAMP_UNIT_MASK 0x000F
#define IEEE80211_RADIOTAP_TIMESTAMP_UNIT_MS 0x0000
#define IEEE80211_RADIOTAP_TIMESTAMP_UNIT_US 0x0001
#define IEEE80211_RADIOTAP_TIMESTAMP_UNIT_NS 0x0003
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_MASK 0x00F0
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_BEGIN_MDPU 0x0000
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_MPDU 0x0010
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_PPDU 0x0020
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_PLCP_SIG_ACQ 0x0030
#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_UNKNOWN 0x00F0

#define IEEE80211_RADIOTAP_TIMESTAMP_FLAG_64BIT 0x00
#define IEEE80211_RADIOTAP_TIMESTAMP_FLAG_32BIT 0x01
#define IEEE80211_RADIOTAP_TIMESTAMP_FLAG_ACCURACY 0x02

/* helpers */
static inline int ieee80211_get_radiotap_len(unsigned char *data)
{
Expand Down
33 changes: 24 additions & 9 deletions include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,9 @@ struct ieee80211_sta_rates {
* @supp_rates: Bitmap of supported rates (per band)
* @ht_cap: HT capabilities of this STA; restricted to our own capabilities
* @vht_cap: VHT capabilities of this STA; restricted to our own capabilities
* @max_rx_aggregation_subframes: maximal amount of frames in a single AMPDU
* that this station is allowed to transmit to us.
* Can be modified by driver.
* @wme: indicates whether the STA supports QoS/WME (if local devices does,
* otherwise always false)
* @drv_priv: data area for driver use, will always be aligned to
Expand Down Expand Up @@ -1775,6 +1778,7 @@ struct ieee80211_sta {
u16 aid;
struct ieee80211_sta_ht_cap ht_cap;
struct ieee80211_sta_vht_cap vht_cap;
u8 max_rx_aggregation_subframes;
bool wme;
u8 uapsd_queues;
u8 max_sp;
Expand Down Expand Up @@ -2014,6 +2018,11 @@ struct ieee80211_txq {
* @IEEE80211_HW_TX_FRAG_LIST: Hardware (or driver) supports sending frag_list
* skbs, needed for zero-copy software A-MSDU.
*
* @IEEE80211_HW_REPORTS_LOW_ACK: The driver (or firmware) reports low ack event
* by ieee80211_report_low_ack() based on its own algorithm. For such
* drivers, mac80211 packet loss mechanism will not be triggered and driver
* is completely depending on firmware event for station kickout.
*
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
*/
enum ieee80211_hw_flags {
Expand Down Expand Up @@ -2054,6 +2063,7 @@ enum ieee80211_hw_flags {
IEEE80211_HW_USES_RSS,
IEEE80211_HW_TX_AMSDU,
IEEE80211_HW_TX_FRAG_LIST,
IEEE80211_HW_REPORTS_LOW_ACK,

/* keep last, obviously */
NUM_IEEE80211_HW_FLAGS
Expand Down Expand Up @@ -2141,6 +2151,14 @@ enum ieee80211_hw_flags {
* the default is _GI | _BANDWIDTH.
* Use the %IEEE80211_RADIOTAP_VHT_KNOWN_* values.
*
* @radiotap_timestamp: Information for the radiotap timestamp field; if the
* 'units_pos' member is set to a non-negative value it must be set to
* a combination of a IEEE80211_RADIOTAP_TIMESTAMP_UNIT_* and a
* IEEE80211_RADIOTAP_TIMESTAMP_SPOS_* value, and then the timestamp
* field will be added and populated from the &struct ieee80211_rx_status
* device_timestamp. If the 'accuracy' member is non-negative, it's put
* into the accuracy radiotap field and the accuracy known flag is set.
*
* @netdev_features: netdev features to be set in each netdev created
* from this HW. Note that not all features are usable with mac80211,
* other features will be rejected during HW registration.
Expand Down Expand Up @@ -2184,6 +2202,10 @@ struct ieee80211_hw {
u8 offchannel_tx_hw_queue;
u8 radiotap_mcs_details;
u16 radiotap_vht_details;
struct {
int units_pos;
s16 accuracy;
} radiotap_timestamp;
netdev_features_t netdev_features;
u8 uapsd_queues;
u8 uapsd_max_sp_len;
Expand Down Expand Up @@ -3085,11 +3107,8 @@ enum ieee80211_reconfig_type {
*
* @sta_add_debugfs: Drivers can use this callback to add debugfs files
* when a station is added to mac80211's station list. This callback
* and @sta_remove_debugfs should be within a CONFIG_MAC80211_DEBUGFS
* conditional. This callback can sleep.
*
* @sta_remove_debugfs: Remove the debugfs files which were added using
* @sta_add_debugfs. This callback can sleep.
* should be within a CONFIG_MAC80211_DEBUGFS conditional. This
* callback can sleep.
*
* @sta_notify: Notifies low level driver about power state transition of an
* associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating
Expand Down Expand Up @@ -3485,10 +3504,6 @@ struct ieee80211_ops {
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
struct dentry *dir);
void (*sta_remove_debugfs)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
struct dentry *dir);
#endif
void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
enum sta_notify_cmd, struct ieee80211_sta *sta);
Expand Down
11 changes: 8 additions & 3 deletions net/mac80211/agg-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,13 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,
buf_size = IEEE80211_MAX_AMPDU_BUF;

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

ht_dbg(sta->sdata, "AddBA Req buf_size=%d for %pM\n",
buf_size, sta->sta.addr);

/* examine state machine */
mutex_lock(&sta->ampdu_mlme.mtx);

Expand Down Expand Up @@ -406,8 +409,10 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,
}

end:
if (status == WLAN_STATUS_SUCCESS)
if (status == WLAN_STATUS_SUCCESS) {
__set_bit(tid, sta->ampdu_mlme.agg_session_valid);
__clear_bit(tid, sta->ampdu_mlme.unexpected_agg);
}
mutex_unlock(&sta->ampdu_mlme.mtx);

end_no_lock:
Expand Down
35 changes: 26 additions & 9 deletions net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy,

if (type == NL80211_IFTYPE_MONITOR && flags) {
sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
sdata->u.mntr_flags = *flags;
sdata->u.mntr.flags = *flags;
}

return wdev;
Expand Down Expand Up @@ -73,8 +73,29 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
sdata->u.mgd.use_4addr = params->use_4addr;
}

if (sdata->vif.type == NL80211_IFTYPE_MONITOR && flags) {
if (sdata->vif.type == NL80211_IFTYPE_MONITOR) {
struct ieee80211_local *local = sdata->local;
struct ieee80211_sub_if_data *monitor_sdata;
u32 mu_mntr_cap_flag = NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER;

monitor_sdata = rtnl_dereference(local->monitor_sdata);
if (monitor_sdata &&
wiphy_ext_feature_isset(wiphy, mu_mntr_cap_flag)) {
memcpy(monitor_sdata->vif.bss_conf.mu_group.membership,
params->vht_mumimo_groups, WLAN_MEMBERSHIP_LEN);
memcpy(monitor_sdata->vif.bss_conf.mu_group.position,
params->vht_mumimo_groups + WLAN_MEMBERSHIP_LEN,
WLAN_USER_POSITION_LEN);
monitor_sdata->vif.mu_mimo_owner = true;
ieee80211_bss_info_change_notify(monitor_sdata,
BSS_CHANGED_MU_GROUPS);

ether_addr_copy(monitor_sdata->u.mntr.mu_follow_addr,
params->macaddr);
}

if (!flags)
return 0;

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

ieee80211_adjust_monitor_flags(sdata, -1);
sdata->u.mntr_flags = *flags;
sdata->u.mntr.flags = *flags;
ieee80211_adjust_monitor_flags(sdata, 1);

ieee80211_configure_filter(local);
Expand All @@ -103,7 +124,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
* and ieee80211_do_open take care of "everything"
* mentioned in the comment above.
*/
sdata->u.mntr_flags = *flags;
sdata->u.mntr.flags = *flags;
}
}

Expand Down Expand Up @@ -2940,10 +2961,6 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
}

chanctx = container_of(conf, struct ieee80211_chanctx, conf);
if (!chanctx) {
err = -EBUSY;
goto out;
}

ch_switch.timestamp = 0;
ch_switch.device_timestamp = 0;
Expand Down
Loading

0 comments on commit c13ed53

Please sign in to comment.