aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-11-17 08:08:11 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-01-08 09:28:10 -0500
commit319090bf6c75e3ad42a8c74973be5e78ae4f948f (patch)
tree499fe25951bd986948c2b0e0552dfeca0784ae3a /net/mac80211
parent2b9a7e1bac24df8ddb0713ad1e5807a7243bcab0 (diff)
cfg80211: remove enum station_info_flags
This is really just duplicating the list of information that's already available in the nl80211 attribute, so remove the list. Two small changes are needed: * remove STATION_INFO_ASSOC_REQ_IES complete, but the length (assoc_req_ies_len) can be used instead * add NL80211_STA_INFO_RX_DROP_MISC which exists internally but not in nl80211 yet This gets rid of the duplicate maintenance of the two lists. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ethtool.c6
-rw-r--r--net/mac80211/sta_info.c80
2 files changed, 43 insertions, 43 deletions
diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c
index eea742710c0a..52bcea6ad9e8 100644
--- a/net/mac80211/ethtool.c
+++ b/net/mac80211/ethtool.c
@@ -117,16 +117,16 @@ static void ieee80211_get_stats(struct net_device *dev,
117 data[i++] = sta->sta_state; 117 data[i++] = sta->sta_state;
118 118
119 119
120 if (sinfo.filled & STATION_INFO_TX_BITRATE) 120 if (sinfo.filled & BIT(NL80211_STA_INFO_TX_BITRATE))
121 data[i] = 100000 * 121 data[i] = 100000 *
122 cfg80211_calculate_bitrate(&sinfo.txrate); 122 cfg80211_calculate_bitrate(&sinfo.txrate);
123 i++; 123 i++;
124 if (sinfo.filled & STATION_INFO_RX_BITRATE) 124 if (sinfo.filled & BIT(NL80211_STA_INFO_RX_BITRATE))
125 data[i] = 100000 * 125 data[i] = 100000 *
126 cfg80211_calculate_bitrate(&sinfo.rxrate); 126 cfg80211_calculate_bitrate(&sinfo.rxrate);
127 i++; 127 i++;
128 128
129 if (sinfo.filled & STATION_INFO_SIGNAL_AVG) 129 if (sinfo.filled & BIT(NL80211_STA_INFO_SIGNAL_AVG))
130 data[i] = (u8)sinfo.signal_avg; 130 data[i] = (u8)sinfo.signal_avg;
131 i++; 131 i++;
132 } else { 132 } else {
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 967b42eae5c2..64b53b943d98 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1756,51 +1756,51 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
1756 1756
1757 drv_sta_statistics(local, sdata, &sta->sta, sinfo); 1757 drv_sta_statistics(local, sdata, &sta->sta, sinfo);
1758 1758
1759 sinfo->filled |= STATION_INFO_INACTIVE_TIME | 1759 sinfo->filled |= BIT(NL80211_STA_INFO_INACTIVE_TIME) |
1760 STATION_INFO_STA_FLAGS | 1760 BIT(NL80211_STA_INFO_STA_FLAGS) |
1761 STATION_INFO_BSS_PARAM | 1761 BIT(NL80211_STA_INFO_BSS_PARAM) |
1762 STATION_INFO_CONNECTED_TIME | 1762 BIT(NL80211_STA_INFO_CONNECTED_TIME) |
1763 STATION_INFO_RX_DROP_MISC | 1763 BIT(NL80211_STA_INFO_RX_DROP_MISC) |
1764 STATION_INFO_BEACON_LOSS_COUNT; 1764 BIT(NL80211_STA_INFO_BEACON_LOSS);
1765 1765
1766 ktime_get_ts(&uptime); 1766 ktime_get_ts(&uptime);
1767 sinfo->connected_time = uptime.tv_sec - sta->last_connected; 1767 sinfo->connected_time = uptime.tv_sec - sta->last_connected;
1768 sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx); 1768 sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
1769 1769
1770 if (!(sinfo->filled & (STATION_INFO_TX_BYTES64 | 1770 if (!(sinfo->filled & (BIT(NL80211_STA_INFO_TX_BYTES64) |
1771 STATION_INFO_TX_BYTES))) { 1771 BIT(NL80211_STA_INFO_TX_BYTES)))) {
1772 sinfo->tx_bytes = 0; 1772 sinfo->tx_bytes = 0;
1773 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) 1773 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
1774 sinfo->tx_bytes += sta->tx_bytes[ac]; 1774 sinfo->tx_bytes += sta->tx_bytes[ac];
1775 sinfo->filled |= STATION_INFO_TX_BYTES64; 1775 sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES64);
1776 } 1776 }
1777 1777
1778 if (!(sinfo->filled & STATION_INFO_TX_PACKETS)) { 1778 if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_PACKETS))) {
1779 sinfo->tx_packets = 0; 1779 sinfo->tx_packets = 0;
1780 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) 1780 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
1781 sinfo->tx_packets += sta->tx_packets[ac]; 1781 sinfo->tx_packets += sta->tx_packets[ac];
1782 sinfo->filled |= STATION_INFO_TX_PACKETS; 1782 sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS);
1783 } 1783 }
1784 1784
1785 if (!(sinfo->filled & (STATION_INFO_RX_BYTES64 | 1785 if (!(sinfo->filled & (BIT(NL80211_STA_INFO_RX_BYTES64) |
1786 STATION_INFO_RX_BYTES))) { 1786 BIT(NL80211_STA_INFO_RX_BYTES)))) {
1787 sinfo->rx_bytes = sta->rx_bytes; 1787 sinfo->rx_bytes = sta->rx_bytes;
1788 sinfo->filled |= STATION_INFO_RX_BYTES64; 1788 sinfo->filled |= BIT(NL80211_STA_INFO_RX_BYTES64);
1789 } 1789 }
1790 1790
1791 if (!(sinfo->filled & STATION_INFO_RX_PACKETS)) { 1791 if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_PACKETS))) {
1792 sinfo->rx_packets = sta->rx_packets; 1792 sinfo->rx_packets = sta->rx_packets;
1793 sinfo->filled |= STATION_INFO_RX_PACKETS; 1793 sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS);
1794 } 1794 }
1795 1795
1796 if (!(sinfo->filled & STATION_INFO_TX_RETRIES)) { 1796 if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_RETRIES))) {
1797 sinfo->tx_retries = sta->tx_retry_count; 1797 sinfo->tx_retries = sta->tx_retry_count;
1798 sinfo->filled |= STATION_INFO_TX_RETRIES; 1798 sinfo->filled |= BIT(NL80211_STA_INFO_TX_RETRIES);
1799 } 1799 }
1800 1800
1801 if (!(sinfo->filled & STATION_INFO_TX_FAILED)) { 1801 if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_FAILED))) {
1802 sinfo->tx_failed = sta->tx_retry_failed; 1802 sinfo->tx_failed = sta->tx_retry_failed;
1803 sinfo->filled |= STATION_INFO_TX_FAILED; 1803 sinfo->filled |= BIT(NL80211_STA_INFO_TX_FAILED);
1804 } 1804 }
1805 1805
1806 sinfo->rx_dropped_misc = sta->rx_dropped; 1806 sinfo->rx_dropped_misc = sta->rx_dropped;
@@ -1808,22 +1808,22 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
1808 1808
1809 if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) || 1809 if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) ||
1810 (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) { 1810 (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) {
1811 if (!(sinfo->filled & STATION_INFO_SIGNAL)) { 1811 if (!(sinfo->filled & BIT(NL80211_STA_INFO_SIGNAL))) {
1812 sinfo->signal = (s8)sta->last_signal; 1812 sinfo->signal = (s8)sta->last_signal;
1813 sinfo->filled |= STATION_INFO_SIGNAL; 1813 sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
1814 } 1814 }
1815 1815
1816 if (!(sinfo->filled & STATION_INFO_SIGNAL_AVG)) { 1816 if (!(sinfo->filled & BIT(NL80211_STA_INFO_SIGNAL_AVG))) {
1817 sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal); 1817 sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal);
1818 sinfo->filled |= STATION_INFO_SIGNAL_AVG; 1818 sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL_AVG);
1819 } 1819 }
1820 } 1820 }
1821 1821
1822 if (sta->chains && 1822 if (sta->chains &&
1823 !(sinfo->filled & (STATION_INFO_CHAIN_SIGNAL | 1823 !(sinfo->filled & (BIT(NL80211_STA_INFO_CHAIN_SIGNAL) |
1824 STATION_INFO_CHAIN_SIGNAL_AVG))) { 1824 BIT(NL80211_STA_INFO_CHAIN_SIGNAL_AVG)))) {
1825 sinfo->filled |= STATION_INFO_CHAIN_SIGNAL | 1825 sinfo->filled |= BIT(NL80211_STA_INFO_CHAIN_SIGNAL) |
1826 STATION_INFO_CHAIN_SIGNAL_AVG; 1826 BIT(NL80211_STA_INFO_CHAIN_SIGNAL_AVG);
1827 1827
1828 sinfo->chains = sta->chains; 1828 sinfo->chains = sta->chains;
1829 for (i = 0; i < ARRAY_SIZE(sinfo->chain_signal); i++) { 1829 for (i = 0; i < ARRAY_SIZE(sinfo->chain_signal); i++) {
@@ -1833,30 +1833,30 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
1833 } 1833 }
1834 } 1834 }
1835 1835
1836 if (!(sinfo->filled & STATION_INFO_TX_BITRATE)) { 1836 if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_BITRATE))) {
1837 sta_set_rate_info_tx(sta, &sta->last_tx_rate, &sinfo->txrate); 1837 sta_set_rate_info_tx(sta, &sta->last_tx_rate, &sinfo->txrate);
1838 sinfo->filled |= STATION_INFO_TX_BITRATE; 1838 sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
1839 } 1839 }
1840 1840
1841 if (!(sinfo->filled & STATION_INFO_RX_BITRATE)) { 1841 if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_BITRATE))) {
1842 sta_set_rate_info_rx(sta, &sinfo->rxrate); 1842 sta_set_rate_info_rx(sta, &sinfo->rxrate);
1843 sinfo->filled |= STATION_INFO_RX_BITRATE; 1843 sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE);
1844 } 1844 }
1845 1845
1846 if (ieee80211_vif_is_mesh(&sdata->vif)) { 1846 if (ieee80211_vif_is_mesh(&sdata->vif)) {
1847#ifdef CONFIG_MAC80211_MESH 1847#ifdef CONFIG_MAC80211_MESH
1848 sinfo->filled |= STATION_INFO_LLID | 1848 sinfo->filled |= BIT(NL80211_STA_INFO_LLID) |
1849 STATION_INFO_PLID | 1849 BIT(NL80211_STA_INFO_PLID) |
1850 STATION_INFO_PLINK_STATE | 1850 BIT(NL80211_STA_INFO_PLINK_STATE) |
1851 STATION_INFO_LOCAL_PM | 1851 BIT(NL80211_STA_INFO_LOCAL_PM) |
1852 STATION_INFO_PEER_PM | 1852 BIT(NL80211_STA_INFO_PEER_PM) |
1853 STATION_INFO_NONPEER_PM; 1853 BIT(NL80211_STA_INFO_NONPEER_PM);
1854 1854
1855 sinfo->llid = sta->llid; 1855 sinfo->llid = sta->llid;
1856 sinfo->plid = sta->plid; 1856 sinfo->plid = sta->plid;
1857 sinfo->plink_state = sta->plink_state; 1857 sinfo->plink_state = sta->plink_state;
1858 if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) { 1858 if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
1859 sinfo->filled |= STATION_INFO_T_OFFSET; 1859 sinfo->filled |= BIT(NL80211_STA_INFO_T_OFFSET);
1860 sinfo->t_offset = sta->t_offset; 1860 sinfo->t_offset = sta->t_offset;
1861 } 1861 }
1862 sinfo->local_pm = sta->local_pm; 1862 sinfo->local_pm = sta->local_pm;
@@ -1905,7 +1905,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
1905 thr = drv_get_expected_throughput(local, &sta->sta); 1905 thr = drv_get_expected_throughput(local, &sta->sta);
1906 1906
1907 if (thr != 0) { 1907 if (thr != 0) {
1908 sinfo->filled |= STATION_INFO_EXPECTED_THROUGHPUT; 1908 sinfo->filled |= BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT);
1909 sinfo->expected_throughput = thr; 1909 sinfo->expected_throughput = thr;
1910 } 1910 }
1911} 1911}