diff options
Diffstat (limited to 'net/mac80211/util.c')
| -rw-r--r-- | net/mac80211/util.c | 56 |
1 files changed, 33 insertions, 23 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 974ebe70f5b0..fbd37d43dfce 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
| @@ -578,7 +578,7 @@ ieee80211_get_vif_queues(struct ieee80211_local *local, | |||
| 578 | 578 | ||
| 579 | void __ieee80211_flush_queues(struct ieee80211_local *local, | 579 | void __ieee80211_flush_queues(struct ieee80211_local *local, |
| 580 | struct ieee80211_sub_if_data *sdata, | 580 | struct ieee80211_sub_if_data *sdata, |
| 581 | unsigned int queues) | 581 | unsigned int queues, bool drop) |
| 582 | { | 582 | { |
| 583 | if (!local->ops->flush) | 583 | if (!local->ops->flush) |
| 584 | return; | 584 | return; |
| @@ -594,7 +594,7 @@ void __ieee80211_flush_queues(struct ieee80211_local *local, | |||
| 594 | IEEE80211_QUEUE_STOP_REASON_FLUSH, | 594 | IEEE80211_QUEUE_STOP_REASON_FLUSH, |
| 595 | false); | 595 | false); |
| 596 | 596 | ||
| 597 | drv_flush(local, sdata, queues, false); | 597 | drv_flush(local, sdata, queues, drop); |
| 598 | 598 | ||
| 599 | ieee80211_wake_queues_by_reason(&local->hw, queues, | 599 | ieee80211_wake_queues_by_reason(&local->hw, queues, |
| 600 | IEEE80211_QUEUE_STOP_REASON_FLUSH, | 600 | IEEE80211_QUEUE_STOP_REASON_FLUSH, |
| @@ -602,9 +602,9 @@ void __ieee80211_flush_queues(struct ieee80211_local *local, | |||
| 602 | } | 602 | } |
| 603 | 603 | ||
| 604 | void ieee80211_flush_queues(struct ieee80211_local *local, | 604 | void ieee80211_flush_queues(struct ieee80211_local *local, |
| 605 | struct ieee80211_sub_if_data *sdata) | 605 | struct ieee80211_sub_if_data *sdata, bool drop) |
| 606 | { | 606 | { |
| 607 | __ieee80211_flush_queues(local, sdata, 0); | 607 | __ieee80211_flush_queues(local, sdata, 0, drop); |
| 608 | } | 608 | } |
| 609 | 609 | ||
| 610 | void ieee80211_stop_vif_queues(struct ieee80211_local *local, | 610 | void ieee80211_stop_vif_queues(struct ieee80211_local *local, |
| @@ -1470,10 +1470,12 @@ static int ieee80211_build_preq_ies_band(struct ieee80211_local *local, | |||
| 1470 | 1470 | ||
| 1471 | /* Check if any channel in this sband supports at least 80 MHz */ | 1471 | /* Check if any channel in this sband supports at least 80 MHz */ |
| 1472 | for (i = 0; i < sband->n_channels; i++) { | 1472 | for (i = 0; i < sband->n_channels; i++) { |
| 1473 | if (!(sband->channels[i].flags & IEEE80211_CHAN_NO_80MHZ)) { | 1473 | if (sband->channels[i].flags & (IEEE80211_CHAN_DISABLED | |
| 1474 | have_80mhz = true; | 1474 | IEEE80211_CHAN_NO_80MHZ)) |
| 1475 | break; | 1475 | continue; |
| 1476 | } | 1476 | |
| 1477 | have_80mhz = true; | ||
| 1478 | break; | ||
| 1477 | } | 1479 | } |
| 1478 | 1480 | ||
| 1479 | if (sband->vht_cap.vht_supported && have_80mhz) { | 1481 | if (sband->vht_cap.vht_supported && have_80mhz) { |
| @@ -1735,6 +1737,10 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
| 1735 | struct cfg80211_sched_scan_request *sched_scan_req; | 1737 | struct cfg80211_sched_scan_request *sched_scan_req; |
| 1736 | bool sched_scan_stopped = false; | 1738 | bool sched_scan_stopped = false; |
| 1737 | 1739 | ||
| 1740 | /* nothing to do if HW shouldn't run */ | ||
| 1741 | if (!local->open_count) | ||
| 1742 | goto wake_up; | ||
| 1743 | |||
| 1738 | #ifdef CONFIG_PM | 1744 | #ifdef CONFIG_PM |
| 1739 | if (local->suspended) | 1745 | if (local->suspended) |
| 1740 | local->resuming = true; | 1746 | local->resuming = true; |
| @@ -1756,9 +1762,6 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
| 1756 | reconfig_due_to_wowlan = true; | 1762 | reconfig_due_to_wowlan = true; |
| 1757 | } | 1763 | } |
| 1758 | #endif | 1764 | #endif |
| 1759 | /* everything else happens only if HW was up & running */ | ||
| 1760 | if (!local->open_count) | ||
| 1761 | goto wake_up; | ||
| 1762 | 1765 | ||
| 1763 | /* | 1766 | /* |
| 1764 | * Upon resume hardware can sometimes be goofy due to | 1767 | * Upon resume hardware can sometimes be goofy due to |
| @@ -2042,7 +2045,7 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
| 2042 | * If this is for hw restart things are still running. | 2045 | * If this is for hw restart things are still running. |
| 2043 | * We may want to change that later, however. | 2046 | * We may want to change that later, however. |
| 2044 | */ | 2047 | */ |
| 2045 | if (!local->suspended || reconfig_due_to_wowlan) | 2048 | if (local->open_count && (!local->suspended || reconfig_due_to_wowlan)) |
| 2046 | drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART); | 2049 | drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART); |
| 2047 | 2050 | ||
| 2048 | if (!local->suspended) | 2051 | if (!local->suspended) |
| @@ -2054,7 +2057,7 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
| 2054 | mb(); | 2057 | mb(); |
| 2055 | local->resuming = false; | 2058 | local->resuming = false; |
| 2056 | 2059 | ||
| 2057 | if (!reconfig_due_to_wowlan) | 2060 | if (local->open_count && !reconfig_due_to_wowlan) |
| 2058 | drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_SUSPEND); | 2061 | drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_SUSPEND); |
| 2059 | 2062 | ||
| 2060 | list_for_each_entry(sdata, &local->interfaces, list) { | 2063 | list_for_each_entry(sdata, &local->interfaces, list) { |
| @@ -2538,7 +2541,9 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local, | |||
| 2538 | ri.mcs = status->rate_idx; | 2541 | ri.mcs = status->rate_idx; |
| 2539 | ri.flags |= RATE_INFO_FLAGS_MCS; | 2542 | ri.flags |= RATE_INFO_FLAGS_MCS; |
| 2540 | if (status->flag & RX_FLAG_40MHZ) | 2543 | if (status->flag & RX_FLAG_40MHZ) |
| 2541 | ri.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH; | 2544 | ri.bw = RATE_INFO_BW_40; |
| 2545 | else | ||
| 2546 | ri.bw = RATE_INFO_BW_20; | ||
| 2542 | if (status->flag & RX_FLAG_SHORT_GI) | 2547 | if (status->flag & RX_FLAG_SHORT_GI) |
| 2543 | ri.flags |= RATE_INFO_FLAGS_SHORT_GI; | 2548 | ri.flags |= RATE_INFO_FLAGS_SHORT_GI; |
| 2544 | } else if (status->flag & RX_FLAG_VHT) { | 2549 | } else if (status->flag & RX_FLAG_VHT) { |
| @@ -2546,13 +2551,13 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local, | |||
| 2546 | ri.mcs = status->rate_idx; | 2551 | ri.mcs = status->rate_idx; |
| 2547 | ri.nss = status->vht_nss; | 2552 | ri.nss = status->vht_nss; |
| 2548 | if (status->flag & RX_FLAG_40MHZ) | 2553 | if (status->flag & RX_FLAG_40MHZ) |
| 2549 | ri.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH; | 2554 | ri.bw = RATE_INFO_BW_40; |
| 2550 | if (status->vht_flag & RX_VHT_FLAG_80MHZ) | 2555 | else if (status->vht_flag & RX_VHT_FLAG_80MHZ) |
| 2551 | ri.flags |= RATE_INFO_FLAGS_80_MHZ_WIDTH; | 2556 | ri.bw = RATE_INFO_BW_80; |
| 2552 | if (status->vht_flag & RX_VHT_FLAG_80P80MHZ) | 2557 | else if (status->vht_flag & RX_VHT_FLAG_160MHZ) |
| 2553 | ri.flags |= RATE_INFO_FLAGS_80P80_MHZ_WIDTH; | 2558 | ri.bw = RATE_INFO_BW_160; |
| 2554 | if (status->vht_flag & RX_VHT_FLAG_160MHZ) | 2559 | else |
| 2555 | ri.flags |= RATE_INFO_FLAGS_160_MHZ_WIDTH; | 2560 | ri.bw = RATE_INFO_BW_20; |
| 2556 | if (status->flag & RX_FLAG_SHORT_GI) | 2561 | if (status->flag & RX_FLAG_SHORT_GI) |
| 2557 | ri.flags |= RATE_INFO_FLAGS_SHORT_GI; | 2562 | ri.flags |= RATE_INFO_FLAGS_SHORT_GI; |
| 2558 | } else { | 2563 | } else { |
| @@ -2560,10 +2565,15 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local, | |||
| 2560 | int shift = 0; | 2565 | int shift = 0; |
| 2561 | int bitrate; | 2566 | int bitrate; |
| 2562 | 2567 | ||
| 2563 | if (status->flag & RX_FLAG_10MHZ) | 2568 | if (status->flag & RX_FLAG_10MHZ) { |
| 2564 | shift = 1; | 2569 | shift = 1; |
| 2565 | if (status->flag & RX_FLAG_5MHZ) | 2570 | ri.bw = RATE_INFO_BW_10; |
| 2571 | } else if (status->flag & RX_FLAG_5MHZ) { | ||
| 2566 | shift = 2; | 2572 | shift = 2; |
| 2573 | ri.bw = RATE_INFO_BW_5; | ||
| 2574 | } else { | ||
| 2575 | ri.bw = RATE_INFO_BW_20; | ||
| 2576 | } | ||
| 2567 | 2577 | ||
| 2568 | sband = local->hw.wiphy->bands[status->band]; | 2578 | sband = local->hw.wiphy->bands[status->band]; |
| 2569 | bitrate = sband->bitrates[status->rate_idx].bitrate; | 2579 | bitrate = sband->bitrates[status->rate_idx].bitrate; |
