udp: fix IP_CHECKSUM handling
[cascardo/linux.git] / net / mac80211 / ibss.c
index fc32383..a31d307 100644 (file)
@@ -126,7 +126,7 @@ ieee80211_ibss_build_presp(struct ieee80211_sub_if_data *sdata,
                }
        }
 
-       if (sband->band == IEEE80211_BAND_2GHZ) {
+       if (sband->band == NL80211_BAND_2GHZ) {
                *pos++ = WLAN_EID_DS_PARAMS;
                *pos++ = 1;
                *pos++ = ieee80211_frequency_to_channel(
@@ -348,11 +348,11 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
         *
         * HT follows these specifications (IEEE 802.11-2012 20.3.18)
         */
-       sdata->vif.bss_conf.use_short_slot = chan->band == IEEE80211_BAND_5GHZ;
+       sdata->vif.bss_conf.use_short_slot = chan->band == NL80211_BAND_5GHZ;
        bss_change |= BSS_CHANGED_ERP_SLOT;
 
        /* cf. IEEE 802.11 9.2.12 */
-       if (chan->band == IEEE80211_BAND_2GHZ && have_higher_than_11mbit)
+       if (chan->band == NL80211_BAND_2GHZ && have_higher_than_11mbit)
                sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
        else
                sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
@@ -649,8 +649,6 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
                return NULL;
        }
 
-       sta->rx_stats.last_rx = jiffies;
-
        /* make sure mandatory rates are always added */
        sband = local->hw.wiphy->bands[band];
        sta->sta.supp_rates[band] = supp_rates |
@@ -670,10 +668,11 @@ static int ieee80211_sta_active_ibss(struct ieee80211_sub_if_data *sdata)
        rcu_read_lock();
 
        list_for_each_entry_rcu(sta, &local->sta_list, list) {
+               unsigned long last_active = ieee80211_sta_last_active(sta);
+
                if (sta->sdata == sdata &&
-                   time_after(sta->rx_stats.last_rx +
-                              IEEE80211_IBSS_MERGE_INTERVAL,
-                              jiffies)) {
+                   time_is_after_jiffies(last_active +
+                                         IEEE80211_IBSS_MERGE_INTERVAL)) {
                        active++;
                        break;
                }
@@ -990,7 +989,7 @@ static void ieee80211_update_sta_info(struct ieee80211_sub_if_data *sdata,
                                      struct ieee80211_channel *channel)
 {
        struct sta_info *sta;
-       enum ieee80211_band band = rx_status->band;
+       enum nl80211_band band = rx_status->band;
        enum nl80211_bss_scan_width scan_width;
        struct ieee80211_local *local = sdata->local;
        struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
@@ -1110,7 +1109,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
        struct ieee80211_channel *channel;
        u64 beacon_timestamp, rx_timestamp;
        u32 supp_rates = 0;
-       enum ieee80211_band band = rx_status->band;
+       enum nl80211_band band = rx_status->band;
 
        channel = ieee80211_get_channel(local->hw.wiphy, rx_status->freq);
        if (!channel)
@@ -1236,8 +1235,6 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
        if (!sta)
                return;
 
-       sta->rx_stats.last_rx = jiffies;
-
        /* make sure mandatory rates are always added */
        sband = local->hw.wiphy->bands[band];
        sta->sta.supp_rates[band] = supp_rates |
@@ -1259,11 +1256,13 @@ static void ieee80211_ibss_sta_expire(struct ieee80211_sub_if_data *sdata)
        mutex_lock(&local->sta_mtx);
 
        list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
+               unsigned long last_active = ieee80211_sta_last_active(sta);
+
                if (sdata != sta->sdata)
                        continue;
 
-               if (time_after(jiffies, sta->rx_stats.last_rx + exp_time) ||
-                   (time_after(jiffies, sta->rx_stats.last_rx + exp_rsn) &&
+               if (time_is_before_jiffies(last_active + exp_time) ||
+                   (time_is_before_jiffies(last_active + exp_rsn) &&
                     sta->sta_state != IEEE80211_STA_AUTHORIZED)) {
                        sta_dbg(sta->sdata, "expiring inactive %sSTA %pM\n",
                                sta->sta_state != IEEE80211_STA_AUTHORIZED ?