summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-03-17 09:41:37 -0400
committerJohannes Berg <johannes.berg@intel.com>2016-04-05 15:34:21 -0400
commitb100e5d622aa8719cc2e776c397817afe24b1f3b (patch)
tree98c7d9e237c1bbebbfbcd2e27cd7a9748d6768a4 /net/mac80211/mlme.c
parent2c61cf9c56cbc4e0a4475232659ac30bb4c28674 (diff)
mac80211: avoid useless memory write on each frame RX
In the likely case that probe_count is 0, don't write to the memory there. Also use ifmgd consistently in the function, instead of using sdata->u.mgd as well. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 281b8d6e5109..2112df4ffb7b 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -122,15 +122,16 @@ void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata)
122{ 122{
123 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 123 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
124 124
125 if (unlikely(!sdata->u.mgd.associated)) 125 if (unlikely(!ifmgd->associated))
126 return; 126 return;
127 127
128 ifmgd->probe_send_count = 0; 128 if (ifmgd->probe_send_count)
129 ifmgd->probe_send_count = 0;
129 130
130 if (ieee80211_hw_check(&sdata->local->hw, CONNECTION_MONITOR)) 131 if (ieee80211_hw_check(&sdata->local->hw, CONNECTION_MONITOR))
131 return; 132 return;
132 133
133 mod_timer(&sdata->u.mgd.conn_mon_timer, 134 mod_timer(&ifmgd->conn_mon_timer,
134 round_jiffies_up(jiffies + IEEE80211_CONNECTION_IDLE_TIME)); 135 round_jiffies_up(jiffies + IEEE80211_CONNECTION_IDLE_TIME));
135} 136}
136 137