| OLD | NEW |
| 1 /* | 1 /* |
| 2 * mac80211 configuration hooks for cfg80211 | 2 * mac80211 configuration hooks for cfg80211 |
| 3 * | 3 * |
| 4 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> | 4 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> |
| 5 * | 5 * |
| 6 * This file is GPLv2 as found in COPYING. | 6 * This file is GPLv2 as found in COPYING. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include <linux/ieee80211.h> | 9 #include <linux/ieee80211.h> |
| 10 #include <linux/nl80211.h> | 10 #include <linux/nl80211.h> |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 skb->dev = sta->sdata->dev; | 627 skb->dev = sta->sdata->dev; |
| 628 skb->protocol = eth_type_trans(skb, sta->sdata->dev); | 628 skb->protocol = eth_type_trans(skb, sta->sdata->dev); |
| 629 memset(skb->cb, 0, sizeof(skb->cb)); | 629 memset(skb->cb, 0, sizeof(skb->cb)); |
| 630 netif_rx_ni(skb); | 630 netif_rx_ni(skb); |
| 631 } | 631 } |
| 632 | 632 |
| 633 static void sta_apply_parameters(struct ieee80211_local *local, | 633 static void sta_apply_parameters(struct ieee80211_local *local, |
| 634 struct sta_info *sta, | 634 struct sta_info *sta, |
| 635 struct station_parameters *params) | 635 struct station_parameters *params) |
| 636 { | 636 { |
| 637 unsigned long flags; |
| 637 u32 rates; | 638 u32 rates; |
| 638 int i, j; | 639 int i, j; |
| 639 struct ieee80211_supported_band *sband; | 640 struct ieee80211_supported_band *sband; |
| 640 struct ieee80211_sub_if_data *sdata = sta->sdata; | 641 struct ieee80211_sub_if_data *sdata = sta->sdata; |
| 641 u32 mask, set; | 642 u32 mask, set; |
| 642 | 643 |
| 643 sband = local->hw.wiphy->bands[local->oper_channel->band]; | 644 sband = local->hw.wiphy->bands[local->oper_channel->band]; |
| 644 | 645 |
| 645 » spin_lock_bh(&sta->lock); | 646 » spin_lock_irqsave(&sta->flaglock, flags); |
| 646 mask = params->sta_flags_mask; | 647 mask = params->sta_flags_mask; |
| 647 set = params->sta_flags_set; | 648 set = params->sta_flags_set; |
| 648 | 649 |
| 649 if (mask & BIT(NL80211_STA_FLAG_AUTHORIZED)) { | 650 if (mask & BIT(NL80211_STA_FLAG_AUTHORIZED)) { |
| 650 sta->flags &= ~WLAN_STA_AUTHORIZED; | 651 sta->flags &= ~WLAN_STA_AUTHORIZED; |
| 651 if (set & BIT(NL80211_STA_FLAG_AUTHORIZED)) | 652 if (set & BIT(NL80211_STA_FLAG_AUTHORIZED)) |
| 652 sta->flags |= WLAN_STA_AUTHORIZED; | 653 sta->flags |= WLAN_STA_AUTHORIZED; |
| 653 } | 654 } |
| 654 | 655 |
| 655 if (mask & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE)) { | 656 if (mask & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE)) { |
| 656 sta->flags &= ~WLAN_STA_SHORT_PREAMBLE; | 657 sta->flags &= ~WLAN_STA_SHORT_PREAMBLE; |
| 657 if (set & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE)) | 658 if (set & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE)) |
| 658 sta->flags |= WLAN_STA_SHORT_PREAMBLE; | 659 sta->flags |= WLAN_STA_SHORT_PREAMBLE; |
| 659 } | 660 } |
| 660 | 661 |
| 661 if (mask & BIT(NL80211_STA_FLAG_WME)) { | 662 if (mask & BIT(NL80211_STA_FLAG_WME)) { |
| 662 sta->flags &= ~WLAN_STA_WME; | 663 sta->flags &= ~WLAN_STA_WME; |
| 663 if (set & BIT(NL80211_STA_FLAG_WME)) | 664 if (set & BIT(NL80211_STA_FLAG_WME)) |
| 664 sta->flags |= WLAN_STA_WME; | 665 sta->flags |= WLAN_STA_WME; |
| 665 } | 666 } |
| 666 | 667 |
| 667 if (mask & BIT(NL80211_STA_FLAG_MFP)) { | 668 if (mask & BIT(NL80211_STA_FLAG_MFP)) { |
| 668 sta->flags &= ~WLAN_STA_MFP; | 669 sta->flags &= ~WLAN_STA_MFP; |
| 669 if (set & BIT(NL80211_STA_FLAG_MFP)) | 670 if (set & BIT(NL80211_STA_FLAG_MFP)) |
| 670 sta->flags |= WLAN_STA_MFP; | 671 sta->flags |= WLAN_STA_MFP; |
| 671 } | 672 } |
| 672 » spin_unlock_bh(&sta->lock); | 673 » spin_unlock_irqrestore(&sta->flaglock, flags); |
| 673 | 674 |
| 674 /* | 675 /* |
| 675 * cfg80211 validates this (1-2007) and allows setting the AID | 676 * cfg80211 validates this (1-2007) and allows setting the AID |
| 676 * only when creating a new station entry | 677 * only when creating a new station entry |
| 677 */ | 678 */ |
| 678 if (params->aid) | 679 if (params->aid) |
| 679 sta->sta.aid = params->aid; | 680 sta->sta.aid = params->aid; |
| 680 | 681 |
| 681 /* | 682 /* |
| 682 * FIXME: updating the following information is racy when this | 683 * FIXME: updating the following information is racy when this |
| (...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1658 .rfkill_poll = ieee80211_rfkill_poll, | 1659 .rfkill_poll = ieee80211_rfkill_poll, |
| 1659 CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) | 1660 CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) |
| 1660 .set_power_mgmt = ieee80211_set_power_mgmt, | 1661 .set_power_mgmt = ieee80211_set_power_mgmt, |
| 1661 .set_bitrate_mask = ieee80211_set_bitrate_mask, | 1662 .set_bitrate_mask = ieee80211_set_bitrate_mask, |
| 1662 .remain_on_channel = ieee80211_remain_on_channel, | 1663 .remain_on_channel = ieee80211_remain_on_channel, |
| 1663 .cancel_remain_on_channel = ieee80211_cancel_remain_on_channel, | 1664 .cancel_remain_on_channel = ieee80211_cancel_remain_on_channel, |
| 1664 .action = ieee80211_action, | 1665 .action = ieee80211_action, |
| 1665 .set_cqm_rssi_config = ieee80211_set_cqm_rssi_config, | 1666 .set_cqm_rssi_config = ieee80211_set_cqm_rssi_config, |
| 1666 .set_cqm_bitrate_config = ieee80211_set_cqm_bitrate_config, | 1667 .set_cqm_bitrate_config = ieee80211_set_cqm_bitrate_config, |
| 1667 }; | 1668 }; |
| OLD | NEW |