Merge tag 'mac80211-next-for-davem-2016-09-16' of git://git.kernel.org/pub/scm/linux...
[cascardo/linux.git] / net / mac80211 / tx.c
index 5023966..61d302d 100644 (file)
@@ -1343,7 +1343,7 @@ static struct sk_buff *fq_tin_dequeue_func(struct fq *fq,
        local = container_of(fq, struct ieee80211_local, fq);
        txqi = container_of(tin, struct txq_info, tin);
        cparams = &local->cparams;
-       cstats = &local->cstats;
+       cstats = &txqi->cstats;
 
        if (flow == &txqi->def_flow)
                cvars = &txqi->def_cvars;
@@ -1403,6 +1403,7 @@ void ieee80211_txq_init(struct ieee80211_sub_if_data *sdata,
        fq_tin_init(&txqi->tin);
        fq_flow_init(&txqi->def_flow);
        codel_vars_init(&txqi->def_cvars);
+       codel_stats_init(&txqi->cstats);
 
        txqi->txq.vif = &sdata->vif;
 
@@ -1441,7 +1442,6 @@ int ieee80211_txq_setup_flows(struct ieee80211_local *local)
                return ret;
 
        codel_params_init(&local->cparams);
-       codel_stats_init(&local->cstats);
        local->cparams.interval = MS2TIME(100);
        local->cparams.target = MS2TIME(20);
        local->cparams.ecn = true;
@@ -1643,7 +1643,7 @@ static bool __ieee80211_tx(struct ieee80211_local *local,
 
        switch (sdata->vif.type) {
        case NL80211_IFTYPE_MONITOR:
-               if (sdata->u.mntr_flags & MONITOR_FLAG_ACTIVE) {
+               if (sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) {
                        vif = &sdata->vif;
                        break;
                }
@@ -2263,15 +2263,9 @@ static int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata,
        case NL80211_IFTYPE_STATION:
                if (sdata->wdev.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) {
                        sta = sta_info_get(sdata, skb->data);
-                       if (sta) {
-                               bool tdls_peer, tdls_auth;
-
-                               tdls_peer = test_sta_flag(sta,
-                                                         WLAN_STA_TDLS_PEER);
-                               tdls_auth = test_sta_flag(sta,
-                                               WLAN_STA_TDLS_PEER_AUTH);
-
-                               if (tdls_peer && tdls_auth) {
+                       if (sta && test_sta_flag(sta, WLAN_STA_TDLS_PEER)) {
+                               if (test_sta_flag(sta,
+                                                 WLAN_STA_TDLS_PEER_AUTH)) {
                                        *sta_out = sta;
                                        return 0;
                                }
@@ -2283,8 +2277,7 @@ static int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata,
                                 * after a TDLS sta is removed due to being
                                 * unreachable.
                                 */
-                               if (tdls_peer && !tdls_auth &&
-                                   !ieee80211_is_tdls_setup(skb))
+                               if (!ieee80211_is_tdls_setup(skb))
                                        return -EINVAL;
                        }
 
@@ -2334,7 +2327,6 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
        struct mesh_path __maybe_unused *mppath = NULL, *mpath = NULL;
        const u8 *encaps_data;
        int encaps_len, skip_header_bytes;
-       int nh_pos, h_pos;
        bool wme_sta = false, authorized = false;
        bool tdls_peer;
        bool multicast;
@@ -2640,13 +2632,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
                encaps_len = 0;
        }
 
-       nh_pos = skb_network_header(skb) - skb->data;
-       h_pos = skb_transport_header(skb) - skb->data;
-
        skb_pull(skb, skip_header_bytes);
-       nh_pos -= skip_header_bytes;
-       h_pos -= skip_header_bytes;
-
        head_need = hdrlen + encaps_len + meshhdrlen - skb_headroom(skb);
 
        /*
@@ -2672,18 +2658,12 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
                }
        }
 
-       if (encaps_data) {
+       if (encaps_data)
                memcpy(skb_push(skb, encaps_len), encaps_data, encaps_len);
-               nh_pos += encaps_len;
-               h_pos += encaps_len;
-       }
 
 #ifdef CONFIG_MAC80211_MESH
-       if (meshhdrlen > 0) {
+       if (meshhdrlen > 0)
                memcpy(skb_push(skb, meshhdrlen), &mesh_hdr, meshhdrlen);
-               nh_pos += meshhdrlen;
-               h_pos += meshhdrlen;
-       }
 #endif
 
        if (ieee80211_is_data_qos(fc)) {
@@ -2699,15 +2679,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
        } else
                memcpy(skb_push(skb, hdrlen), &hdr, hdrlen);
 
-       nh_pos += hdrlen;
-       h_pos += hdrlen;
-
-       /* Update skb pointers to various headers since this modified frame
-        * is going to go through Linux networking code that may potentially
-        * need things like pointer to IP header. */
        skb_reset_mac_header(skb);
-       skb_set_network_header(skb, nh_pos);
-       skb_set_transport_header(skb, h_pos);
 
        info = IEEE80211_SKB_CB(skb);
        memset(info, 0, sizeof(*info));
@@ -4390,9 +4362,6 @@ void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
        int ac = ieee802_1d_to_ac[tid & 7];
 
        skb_reset_mac_header(skb);
-       skb_reset_network_header(skb);
-       skb_reset_transport_header(skb);
-
        skb_set_queue_mapping(skb, ac);
        skb->priority = tid;