diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-04-26 03:54:11 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-04-27 05:01:13 -0400 |
commit | d686b920abb7136e0575ec974cd5a24f51a7a549 (patch) | |
tree | 1582dc53ba39bd62a84fa29d32771c387e0309b5 /net/wireless/nl80211.c | |
parent | 9b95fe59b18bcc891a6c60ae11d725c9c679574b (diff) |
nl80211: use nla_put_u64_64bit() for the remaining u64 attributes
Nicolas converted most users, but didn't realize some were generated
by macros. Convert those over as well.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 5b0d2c8c2165..9bc84a2ddd34 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3755,11 +3755,18 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, | |||
3755 | goto nla_put_failure; | 3755 | goto nla_put_failure; |
3756 | 3756 | ||
3757 | #define PUT_SINFO(attr, memb, type) do { \ | 3757 | #define PUT_SINFO(attr, memb, type) do { \ |
3758 | BUILD_BUG_ON(sizeof(type) == sizeof(u64)); \ | ||
3758 | if (sinfo->filled & (1ULL << NL80211_STA_INFO_ ## attr) && \ | 3759 | if (sinfo->filled & (1ULL << NL80211_STA_INFO_ ## attr) && \ |
3759 | nla_put_ ## type(msg, NL80211_STA_INFO_ ## attr, \ | 3760 | nla_put_ ## type(msg, NL80211_STA_INFO_ ## attr, \ |
3760 | sinfo->memb)) \ | 3761 | sinfo->memb)) \ |
3761 | goto nla_put_failure; \ | 3762 | goto nla_put_failure; \ |
3762 | } while (0) | 3763 | } while (0) |
3764 | #define PUT_SINFO_U64(attr, memb) do { \ | ||
3765 | if (sinfo->filled & (1ULL << NL80211_STA_INFO_ ## attr) && \ | ||
3766 | nla_put_u64_64bit(msg, NL80211_STA_INFO_ ## attr, \ | ||
3767 | sinfo->memb, NL80211_STA_INFO_PAD)) \ | ||
3768 | goto nla_put_failure; \ | ||
3769 | } while (0) | ||
3763 | 3770 | ||
3764 | PUT_SINFO(CONNECTED_TIME, connected_time, u32); | 3771 | PUT_SINFO(CONNECTED_TIME, connected_time, u32); |
3765 | PUT_SINFO(INACTIVE_TIME, inactive_time, u32); | 3772 | PUT_SINFO(INACTIVE_TIME, inactive_time, u32); |
@@ -3776,12 +3783,12 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, | |||
3776 | (u32)sinfo->tx_bytes)) | 3783 | (u32)sinfo->tx_bytes)) |
3777 | goto nla_put_failure; | 3784 | goto nla_put_failure; |
3778 | 3785 | ||
3779 | PUT_SINFO(RX_BYTES64, rx_bytes, u64); | 3786 | PUT_SINFO_U64(RX_BYTES64, rx_bytes); |
3780 | PUT_SINFO(TX_BYTES64, tx_bytes, u64); | 3787 | PUT_SINFO_U64(TX_BYTES64, tx_bytes); |
3781 | PUT_SINFO(LLID, llid, u16); | 3788 | PUT_SINFO(LLID, llid, u16); |
3782 | PUT_SINFO(PLID, plid, u16); | 3789 | PUT_SINFO(PLID, plid, u16); |
3783 | PUT_SINFO(PLINK_STATE, plink_state, u8); | 3790 | PUT_SINFO(PLINK_STATE, plink_state, u8); |
3784 | PUT_SINFO(RX_DURATION, rx_duration, u64); | 3791 | PUT_SINFO_U64(RX_DURATION, rx_duration); |
3785 | 3792 | ||
3786 | switch (rdev->wiphy.signal_type) { | 3793 | switch (rdev->wiphy.signal_type) { |
3787 | case CFG80211_SIGNAL_TYPE_MBM: | 3794 | case CFG80211_SIGNAL_TYPE_MBM: |
@@ -3849,12 +3856,13 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, | |||
3849 | &sinfo->sta_flags)) | 3856 | &sinfo->sta_flags)) |
3850 | goto nla_put_failure; | 3857 | goto nla_put_failure; |
3851 | 3858 | ||
3852 | PUT_SINFO(T_OFFSET, t_offset, u64); | 3859 | PUT_SINFO_U64(T_OFFSET, t_offset); |
3853 | PUT_SINFO(RX_DROP_MISC, rx_dropped_misc, u64); | 3860 | PUT_SINFO_U64(RX_DROP_MISC, rx_dropped_misc); |
3854 | PUT_SINFO(BEACON_RX, rx_beacon, u64); | 3861 | PUT_SINFO_U64(BEACON_RX, rx_beacon); |
3855 | PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8); | 3862 | PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8); |
3856 | 3863 | ||
3857 | #undef PUT_SINFO | 3864 | #undef PUT_SINFO |
3865 | #undef PUT_SINFO_U64 | ||
3858 | 3866 | ||
3859 | if (sinfo->filled & BIT(NL80211_STA_INFO_TID_STATS)) { | 3867 | if (sinfo->filled & BIT(NL80211_STA_INFO_TID_STATS)) { |
3860 | struct nlattr *tidsattr; | 3868 | struct nlattr *tidsattr; |
@@ -3877,19 +3885,19 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, | |||
3877 | if (!tidattr) | 3885 | if (!tidattr) |
3878 | goto nla_put_failure; | 3886 | goto nla_put_failure; |
3879 | 3887 | ||
3880 | #define PUT_TIDVAL(attr, memb, type) do { \ | 3888 | #define PUT_TIDVAL_U64(attr, memb) do { \ |
3881 | if (tidstats->filled & BIT(NL80211_TID_STATS_ ## attr) && \ | 3889 | if (tidstats->filled & BIT(NL80211_TID_STATS_ ## attr) && \ |
3882 | nla_put_ ## type(msg, NL80211_TID_STATS_ ## attr, \ | 3890 | nla_put_u64_64bit(msg, NL80211_TID_STATS_ ## attr, \ |
3883 | tidstats->memb)) \ | 3891 | tidstats->memb, NL80211_TID_STATS_PAD)) \ |
3884 | goto nla_put_failure; \ | 3892 | goto nla_put_failure; \ |
3885 | } while (0) | 3893 | } while (0) |
3886 | 3894 | ||
3887 | PUT_TIDVAL(RX_MSDU, rx_msdu, u64); | 3895 | PUT_TIDVAL_U64(RX_MSDU, rx_msdu); |
3888 | PUT_TIDVAL(TX_MSDU, tx_msdu, u64); | 3896 | PUT_TIDVAL_U64(TX_MSDU, tx_msdu); |
3889 | PUT_TIDVAL(TX_MSDU_RETRIES, tx_msdu_retries, u64); | 3897 | PUT_TIDVAL_U64(TX_MSDU_RETRIES, tx_msdu_retries); |
3890 | PUT_TIDVAL(TX_MSDU_FAILED, tx_msdu_failed, u64); | 3898 | PUT_TIDVAL_U64(TX_MSDU_FAILED, tx_msdu_failed); |
3891 | 3899 | ||
3892 | #undef PUT_TIDVAL | 3900 | #undef PUT_TIDVAL_U64 |
3893 | nla_nest_end(msg, tidattr); | 3901 | nla_nest_end(msg, tidattr); |
3894 | } | 3902 | } |
3895 | 3903 | ||