Ticket #417: madwifi-parent.3.2.diff

File madwifi-parent.3.2.diff, 5.0 kB (added by mentor, 6 years ago)

To go to the list

  • net80211/ieee80211_input.c

    old new  
    5353#include "if_athproto.h" 
    5454 
    5555#include <net80211/ieee80211_var.h> 
     56#include <net80211/ieee80211_proto.h> 
    5657 
    5758#ifdef IEEE80211_DEBUG 
    5859/* 
     
    33173318                        vap->iv_set_tim(ni, 0); 
    33183319        } 
    33193320        M_PWR_SAV_SET(skb);             /* bypass PS handling */ 
    3320         skb->dev = vap->iv_dev;         /* XXX needed? */ 
    3321        (void) dev_queue_xmit(skb);     /* resubmit */ 
     3321 
     3322       ieee80211_parent_queue_xmit(skb);       /* Submit to parent device, including updating stats */ 
    33223323} 
    33233324 
    33243325#ifdef ATH_SUPERG_FF 
  • net80211/ieee80211_output.c

    old new  
    226226         
    227227        if (vap->iv_opmode == IEEE80211_M_MONITOR) { 
    228228                ieee80211_monitor_encap(vap, skb); 
    229                 skb->dev = parent; 
    230                 (void) dev_queue_xmit(skb); 
     229                ieee80211_parent_queue_xmit(skb); 
    231230                return 0; 
    232231        } 
    233232        if (ic->ic_flags & IEEE80211_F_SCAN)            /* cancel bg scan */ 
     
    252251                        "%s: discard, classification failure", __func__); 
    253252                goto bad; 
    254253        } 
     254         
     255        cb->ni = ni; 
     256         
    255257        /* power-save checks */ 
    256258        if (WME_UAPSD_AC_CAN_TRIGGER(skb->priority, ni)) { 
    257259                /* U-APSD power save queue */ 
    258260                /* XXXAPSD: assuming triggerable means deliverable */ 
    259261                M_FLAG_SET(skb, M_UAPSD); 
    260         } else if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && !M_PWR_SAV_GET(skb)) { 
     262        } else if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT)) { 
    261263                /* 
    262264                 * Station in power save mode; stick the frame 
    263265                 * on the sta's power save queue and continue. 
    264266                 * We'll get the frame back when the time is right. 
    265267                 */ 
    266268                ieee80211_pwrsave(ni, skb); 
    267                 goto reclaim
     269                return 0
    268270        } 
    269         M_FLAG_KEEP_ONLY(skb, M_UAPSD | M_PWR_SAV); 
    270         cb->ni = ni; 
    271271 
    272         vap->iv_devstats.tx_packets++; 
    273         vap->iv_devstats.tx_bytes += skb->len; 
    274         ic->ic_lastdata = jiffies; 
    275  
    276         skb->dev = parent; 
    277272#ifdef ATH_SUPERG_XR 
    278273        /*  
    279274         * broadcast/multicast  packets need to be sent on XR vap in addition to 
    280275         * normal vap. 
    281276         */ 
     277 
     278        /* FIXME: ieee80211_parent_queue_xmit */ 
    282279        if (vap->iv_xrvap && ni == vap->iv_bss && 
    283280            vap->iv_xrvap->iv_sta_assoc) { 
    284281                struct sk_buff *skb1; 
     
    293290                } 
    294291        } 
    295292#endif 
    296         (void) dev_queue_xmit(skb); 
     293        ieee80211_parent_queue_xmit(skb); 
    297294        return 0; 
    298295bad: 
    299296        if (skb != NULL) 
    300297                dev_kfree_skb(skb); 
    301 reclaim: 
    302         if (ni != NULL) 
    303                 ieee80211_free_node(ni); 
    304         return 0; 
    305298} 
    306299 
     300void ieee80211_parent_queue_xmit(struct sk_buff *skb) { 
     301        struct ieee80211vap *vap = skb->dev->priv; 
     302 
     303        vap->iv_devstats.tx_packets++; 
     304        vap->iv_devstats.tx_bytes += skb->len; 
     305        vap->iv_ic->ic_lastdata = jiffies; 
     306 
     307        // Dispatch the packet to the parent device 
     308        skb->dev = vap->iv_ic->ic_dev; 
     309        (void) dev_queue_xmit(skb); 
     310} 
     311 
    307312/* 
    308313 * Set the direction field and address fields of an outgoing 
    309314 * non-QoS frame.  Note this should be called early on in 
  • net80211/ieee80211_power.c

    old new  
    4848#include "if_media.h" 
    4949 
    5050#include <net80211/ieee80211_var.h> 
     51#include <net80211/ieee80211_proto.h> 
    5152 
    5253static void ieee80211_set_tim(struct ieee80211_node *ni, int set); 
    5354 
     
    111112 
    112113        IEEE80211_NODE_SAVEQ_LOCK(ni); 
    113114        qlen = skb_queue_len(&ni->ni_savedq); 
    114         while ((skb = __skb_dequeue(&ni->ni_savedq)) != NULL) 
     115        while ((skb = __skb_dequeue(&ni->ni_savedq)) != NULL) { 
     116                ieee80211_free_node(ni); 
    115117                dev_kfree_skb_any(skb); 
     118        } 
    116119        IEEE80211_NODE_SAVEQ_UNLOCK(ni); 
    117120 
    118121        return qlen; 
     
    208211 
    209212        spin_lock_irqsave(&ni->ni_savedq.lock, flags); 
    210213        if (skb_queue_len(&ni->ni_savedq) >= IEEE80211_PS_MAX_QUEUE) { 
    211                 IEEE80211_NODE_STAT(ni,psq_drops); 
     214                IEEE80211_NODE_STAT(ni, psq_drops); 
    212215                spin_unlock_irqrestore(&ni->ni_savedq.lock, flags); 
    213216                IEEE80211_NOTE(vap, IEEE80211_MSG_ANY, ni, 
    214217                        "pwr save q overflow, drops %d (size %d)", 
     
    313316                        skb->dev = vap->iv_xrvap->iv_dev; 
    314317                else 
    315318                        skb->dev = vap->iv_dev;         /* XXX? unnecessary */ 
    316 #else 
    317                 skb->dev = vap->iv_dev;         /* XXX? unnecessary */ 
    318319#endif 
    319                 dev_queue_xmit(skb); 
     320                 
     321                ieee80211_parent_queue_xmit(skb); 
    320322        } 
    321323        vap->iv_set_tim(ni, 0); 
    322324} 
     
    356358                                IEEE80211_NODE_SAVEQ_UNLOCK(ni); 
    357359                                if (skb == NULL) 
    358360                                        break; 
    359                                 dev_queue_xmit(skb); 
     361                                ieee80211_parent_queue_xmit(skb); 
    360362                        } 
    361363                } 
    362364        } else { 
  • net80211/ieee80211_proto.h

    old new  
    7272        int, int, u_int32_t); 
    7373void ieee80211_sta_pwrsave(struct ieee80211vap *, int); 
    7474int ieee80211_hardstart(struct sk_buff *, struct net_device *); 
     75void ieee80211_parent_queue_xmit(struct sk_buff *); 
    7576int ieee80211_send_nulldata(struct ieee80211_node *); 
    7677int ieee80211_send_qosnulldata(struct ieee80211_node *, int); 
    7778int ieee80211_send_mgmt(struct ieee80211_node *, int, int);