aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index fb89e1d0aa03..73c7d7345abd 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -41,6 +41,15 @@ const unsigned char rfc1042_header[] __aligned(2) =
41const unsigned char bridge_tunnel_header[] __aligned(2) = 41const unsigned char bridge_tunnel_header[] __aligned(2) =
42 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; 42 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
43 43
44struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy)
45{
46 struct ieee80211_local *local;
47 BUG_ON(!wiphy);
48
49 local = wiphy_priv(wiphy);
50 return &local->hw;
51}
52EXPORT_SYMBOL(wiphy_to_ieee80211_hw);
44 53
45u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, 54u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
46 enum nl80211_iftype type) 55 enum nl80211_iftype type)
@@ -352,8 +361,8 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
352 } 361 }
353} 362}
354 363
355void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, 364static void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue,
356 enum queue_stop_reason reason) 365 enum queue_stop_reason reason)
357{ 366{
358 struct ieee80211_local *local = hw_to_local(hw); 367 struct ieee80211_local *local = hw_to_local(hw);
359 unsigned long flags; 368 unsigned long flags;
@@ -382,8 +391,8 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue,
382 netif_stop_subqueue(local->mdev, queue); 391 netif_stop_subqueue(local->mdev, queue);
383} 392}
384 393
385void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, 394static void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
386 enum queue_stop_reason reason) 395 enum queue_stop_reason reason)
387{ 396{
388 struct ieee80211_local *local = hw_to_local(hw); 397 struct ieee80211_local *local = hw_to_local(hw);
389 unsigned long flags; 398 unsigned long flags;
@@ -459,7 +468,7 @@ void ieee80211_iterate_active_interfaces(
459 struct ieee80211_local *local = hw_to_local(hw); 468 struct ieee80211_local *local = hw_to_local(hw);
460 struct ieee80211_sub_if_data *sdata; 469 struct ieee80211_sub_if_data *sdata;
461 470
462 rtnl_lock(); 471 mutex_lock(&local->iflist_mtx);
463 472
464 list_for_each_entry(sdata, &local->interfaces, list) { 473 list_for_each_entry(sdata, &local->interfaces, list) {
465 switch (sdata->vif.type) { 474 switch (sdata->vif.type) {
@@ -480,7 +489,7 @@ void ieee80211_iterate_active_interfaces(
480 &sdata->vif); 489 &sdata->vif);
481 } 490 }
482 491
483 rtnl_unlock(); 492 mutex_unlock(&local->iflist_mtx);
484} 493}
485EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces); 494EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces);
486 495
@@ -653,6 +662,10 @@ void ieee802_11_parse_elems(u8 *start, size_t len,
653 elems->pwr_constr_elem = pos; 662 elems->pwr_constr_elem = pos;
654 elems->pwr_constr_elem_len = elen; 663 elems->pwr_constr_elem_len = elen;
655 break; 664 break;
665 case WLAN_EID_TIMEOUT_INTERVAL:
666 elems->timeout_int = pos;
667 elems->timeout_int_len = elen;
668 break;
656 default: 669 default:
657 break; 670 break;
658 } 671 }
@@ -727,12 +740,12 @@ int ieee80211_set_freq(struct ieee80211_sub_if_data *sdata, int freqMHz)
727 return ret; 740 return ret;
728} 741}
729 742
730u64 ieee80211_mandatory_rates(struct ieee80211_local *local, 743u32 ieee80211_mandatory_rates(struct ieee80211_local *local,
731 enum ieee80211_band band) 744 enum ieee80211_band band)
732{ 745{
733 struct ieee80211_supported_band *sband; 746 struct ieee80211_supported_band *sband;
734 struct ieee80211_rate *bitrates; 747 struct ieee80211_rate *bitrates;
735 u64 mandatory_rates; 748 u32 mandatory_rates;
736 enum ieee80211_rate_flags mandatory_flag; 749 enum ieee80211_rate_flags mandatory_flag;
737 int i; 750 int i;
738 751