Skip to content

Commit

Permalink
Merge tag 'mac80211-for-davem-2015-01-23' of git://git.kernel.org/pub…
Browse files Browse the repository at this point in the history
…/scm/linux/kernel/git/jberg/mac80211

Another set of last-minute fixes:
 * fix station double-removal when suspending while associating
 * fix the HT (802.11n) header length calculation
 * fix the CCK radiotap flag used for monitoring, a pretty
   old regression but a simple one-liner
 * fix per-station group-key handling

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Jan 27, 2015
2 parents df4d925 + 0fa7b39 commit 7d63585
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
29 changes: 15 additions & 14 deletions net/mac80211/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,6 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
}
}

/* tear down aggregation sessions and remove STAs */
mutex_lock(&local->sta_mtx);
list_for_each_entry(sta, &local->sta_list, list) {
if (sta->uploaded) {
enum ieee80211_sta_state state;

state = sta->sta_state;
for (; state > IEEE80211_STA_NOTEXIST; state--)
WARN_ON(drv_sta_state(local, sta->sdata, sta,
state, state - 1));
}
}
mutex_unlock(&local->sta_mtx);

/* remove all interfaces that were created in the driver */
list_for_each_entry(sdata, &local->interfaces, list) {
if (!ieee80211_sdata_running(sdata))
Expand All @@ -111,6 +97,21 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
case NL80211_IFTYPE_STATION:
ieee80211_mgd_quiesce(sdata);
break;
case NL80211_IFTYPE_WDS:
/* tear down aggregation sessions and remove STAs */
mutex_lock(&local->sta_mtx);
sta = sdata->u.wds.sta;
if (sta && sta->uploaded) {
enum ieee80211_sta_state state;

state = sta->sta_state;
for (; state > IEEE80211_STA_NOTEXIST; state--)
WARN_ON(drv_sta_state(local, sta->sdata,
sta, state,
state - 1));
}
mutex_unlock(&local->sta_mtx);
break;
default:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
else if (rate && rate->flags & IEEE80211_RATE_ERP_G)
channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ;
else if (rate)
channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ;
channel_flags |= IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ;
else
channel_flags |= IEEE80211_CHAN_2GHZ;
put_unaligned_le16(channel_flags, pos);
Expand Down
9 changes: 4 additions & 5 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2854,6 +2854,9 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
if (!rdev->ops->get_key)
return -EOPNOTSUPP;

if (!pairwise && mac_addr && !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
return -ENOENT;

msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return -ENOMEM;
Expand All @@ -2873,10 +2876,6 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr))
goto nla_put_failure;

if (pairwise && mac_addr &&
!(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
return -ENOENT;

err = rdev_get_key(rdev, dev, key_idx, pairwise, mac_addr, &cookie,
get_key_callback);

Expand Down Expand Up @@ -3047,7 +3046,7 @@ static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)
wdev_lock(dev->ieee80211_ptr);
err = nl80211_key_allowed(dev->ieee80211_ptr);

if (key.type == NL80211_KEYTYPE_PAIRWISE && mac_addr &&
if (key.type == NL80211_KEYTYPE_GROUP && mac_addr &&
!(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
err = -ENOENT;

Expand Down
6 changes: 6 additions & 0 deletions net/wireless/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc)
goto out;
}

if (ieee80211_is_mgmt(fc)) {
if (ieee80211_has_order(fc))
hdrlen += IEEE80211_HT_CTL_LEN;
goto out;
}

if (ieee80211_is_ctl(fc)) {
/*
* ACK and CTS are 10 bytes, all others 16. To see how
Expand Down

0 comments on commit 7d63585

Please sign in to comment.