diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 62 |
1 files changed, 49 insertions, 13 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index be70c70d3f5b..bfc36e904764 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -209,6 +209,7 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev, | |||
209 | u8 seq[6] = {0}; | 209 | u8 seq[6] = {0}; |
210 | struct key_params params; | 210 | struct key_params params; |
211 | struct ieee80211_key *key = NULL; | 211 | struct ieee80211_key *key = NULL; |
212 | u64 pn64; | ||
212 | u32 iv32; | 213 | u32 iv32; |
213 | u16 iv16; | 214 | u16 iv16; |
214 | int err = -ENOENT; | 215 | int err = -ENOENT; |
@@ -256,22 +257,24 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev, | |||
256 | params.seq_len = 6; | 257 | params.seq_len = 6; |
257 | break; | 258 | break; |
258 | case WLAN_CIPHER_SUITE_CCMP: | 259 | case WLAN_CIPHER_SUITE_CCMP: |
259 | seq[0] = key->u.ccmp.tx_pn[5]; | 260 | pn64 = atomic64_read(&key->u.ccmp.tx_pn); |
260 | seq[1] = key->u.ccmp.tx_pn[4]; | 261 | seq[0] = pn64; |
261 | seq[2] = key->u.ccmp.tx_pn[3]; | 262 | seq[1] = pn64 >> 8; |
262 | seq[3] = key->u.ccmp.tx_pn[2]; | 263 | seq[2] = pn64 >> 16; |
263 | seq[4] = key->u.ccmp.tx_pn[1]; | 264 | seq[3] = pn64 >> 24; |
264 | seq[5] = key->u.ccmp.tx_pn[0]; | 265 | seq[4] = pn64 >> 32; |
266 | seq[5] = pn64 >> 40; | ||
265 | params.seq = seq; | 267 | params.seq = seq; |
266 | params.seq_len = 6; | 268 | params.seq_len = 6; |
267 | break; | 269 | break; |
268 | case WLAN_CIPHER_SUITE_AES_CMAC: | 270 | case WLAN_CIPHER_SUITE_AES_CMAC: |
269 | seq[0] = key->u.aes_cmac.tx_pn[5]; | 271 | pn64 = atomic64_read(&key->u.aes_cmac.tx_pn); |
270 | seq[1] = key->u.aes_cmac.tx_pn[4]; | 272 | seq[0] = pn64; |
271 | seq[2] = key->u.aes_cmac.tx_pn[3]; | 273 | seq[1] = pn64 >> 8; |
272 | seq[3] = key->u.aes_cmac.tx_pn[2]; | 274 | seq[2] = pn64 >> 16; |
273 | seq[4] = key->u.aes_cmac.tx_pn[1]; | 275 | seq[3] = pn64 >> 24; |
274 | seq[5] = key->u.aes_cmac.tx_pn[0]; | 276 | seq[4] = pn64 >> 32; |
277 | seq[5] = pn64 >> 40; | ||
275 | params.seq = seq; | 278 | params.seq = seq; |
276 | params.seq_len = 6; | 279 | params.seq_len = 6; |
277 | break; | 280 | break; |
@@ -674,8 +677,11 @@ static void sta_apply_parameters(struct ieee80211_local *local, | |||
674 | 677 | ||
675 | if (mask & BIT(NL80211_STA_FLAG_WME)) { | 678 | if (mask & BIT(NL80211_STA_FLAG_WME)) { |
676 | sta->flags &= ~WLAN_STA_WME; | 679 | sta->flags &= ~WLAN_STA_WME; |
677 | if (set & BIT(NL80211_STA_FLAG_WME)) | 680 | sta->sta.wme = false; |
681 | if (set & BIT(NL80211_STA_FLAG_WME)) { | ||
678 | sta->flags |= WLAN_STA_WME; | 682 | sta->flags |= WLAN_STA_WME; |
683 | sta->sta.wme = true; | ||
684 | } | ||
679 | } | 685 | } |
680 | 686 | ||
681 | if (mask & BIT(NL80211_STA_FLAG_MFP)) { | 687 | if (mask & BIT(NL80211_STA_FLAG_MFP)) { |
@@ -1554,6 +1560,19 @@ static int ieee80211_testmode_cmd(struct wiphy *wiphy, void *data, int len) | |||
1554 | 1560 | ||
1555 | return local->ops->testmode_cmd(&local->hw, data, len); | 1561 | return local->ops->testmode_cmd(&local->hw, data, len); |
1556 | } | 1562 | } |
1563 | |||
1564 | static int ieee80211_testmode_dump(struct wiphy *wiphy, | ||
1565 | struct sk_buff *skb, | ||
1566 | struct netlink_callback *cb, | ||
1567 | void *data, int len) | ||
1568 | { | ||
1569 | struct ieee80211_local *local = wiphy_priv(wiphy); | ||
1570 | |||
1571 | if (!local->ops->testmode_dump) | ||
1572 | return -EOPNOTSUPP; | ||
1573 | |||
1574 | return local->ops->testmode_dump(&local->hw, skb, cb, data, len); | ||
1575 | } | ||
1557 | #endif | 1576 | #endif |
1558 | 1577 | ||
1559 | int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata, | 1578 | int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata, |
@@ -2085,6 +2104,21 @@ static void ieee80211_get_ringparam(struct wiphy *wiphy, | |||
2085 | drv_get_ringparam(local, tx, tx_max, rx, rx_max); | 2104 | drv_get_ringparam(local, tx, tx_max, rx, rx_max); |
2086 | } | 2105 | } |
2087 | 2106 | ||
2107 | static int ieee80211_set_rekey_data(struct wiphy *wiphy, | ||
2108 | struct net_device *dev, | ||
2109 | struct cfg80211_gtk_rekey_data *data) | ||
2110 | { | ||
2111 | struct ieee80211_local *local = wiphy_priv(wiphy); | ||
2112 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
2113 | |||
2114 | if (!local->ops->set_rekey_data) | ||
2115 | return -EOPNOTSUPP; | ||
2116 | |||
2117 | drv_set_rekey_data(local, sdata, data); | ||
2118 | |||
2119 | return 0; | ||
2120 | } | ||
2121 | |||
2088 | struct cfg80211_ops mac80211_config_ops = { | 2122 | struct cfg80211_ops mac80211_config_ops = { |
2089 | .add_virtual_intf = ieee80211_add_iface, | 2123 | .add_virtual_intf = ieee80211_add_iface, |
2090 | .del_virtual_intf = ieee80211_del_iface, | 2124 | .del_virtual_intf = ieee80211_del_iface, |
@@ -2134,6 +2168,7 @@ struct cfg80211_ops mac80211_config_ops = { | |||
2134 | .set_wds_peer = ieee80211_set_wds_peer, | 2168 | .set_wds_peer = ieee80211_set_wds_peer, |
2135 | .rfkill_poll = ieee80211_rfkill_poll, | 2169 | .rfkill_poll = ieee80211_rfkill_poll, |
2136 | CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) | 2170 | CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) |
2171 | CFG80211_TESTMODE_DUMP(ieee80211_testmode_dump) | ||
2137 | .set_power_mgmt = ieee80211_set_power_mgmt, | 2172 | .set_power_mgmt = ieee80211_set_power_mgmt, |
2138 | .set_bitrate_mask = ieee80211_set_bitrate_mask, | 2173 | .set_bitrate_mask = ieee80211_set_bitrate_mask, |
2139 | .remain_on_channel = ieee80211_remain_on_channel, | 2174 | .remain_on_channel = ieee80211_remain_on_channel, |
@@ -2146,4 +2181,5 @@ struct cfg80211_ops mac80211_config_ops = { | |||
2146 | .get_antenna = ieee80211_get_antenna, | 2181 | .get_antenna = ieee80211_get_antenna, |
2147 | .set_ringparam = ieee80211_set_ringparam, | 2182 | .set_ringparam = ieee80211_set_ringparam, |
2148 | .get_ringparam = ieee80211_get_ringparam, | 2183 | .get_ringparam = ieee80211_get_ringparam, |
2184 | .set_rekey_data = ieee80211_set_rekey_data, | ||
2149 | }; | 2185 | }; |