Ticket #907: madwifi-parent.6.diff

File madwifi-parent.6.diff, 5.5 kB (added by mentor, 5 years ago)
  • 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/* 
     
    33163317                if (vap->iv_set_tim != NULL) 
    33173318                        vap->iv_set_tim(ni, 0); 
    33183319        } 
    3319         M_PWR_SAV_SET(skb);             /* bypass PS handling */ 
    3320         skb->dev = vap->iv_dev;         /* XXX needed? */ 
    3321        (void) dev_queue_xmit(skb);     /* resubmit */ 
     3320        M_PWR_SAV_SET(skb);             /* ensure MORE_DATA bit is set correctly */ 
     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; 
     295 
    298296bad: 
    299297        if (skb != NULL) 
    300298                dev_kfree_skb(skb); 
    301 reclaim: 
    302299        if (ni != NULL) 
    303300                ieee80211_free_node(ni); 
    304301        return 0; 
    305302} 
    306303 
     304void ieee80211_parent_queue_xmit(struct sk_buff *skb) { 
     305        struct ieee80211vap *vap = skb->dev->priv; 
     306 
     307        vap->iv_devstats.tx_packets++; 
     308        vap->iv_devstats.tx_bytes += skb->len; 
     309        vap->iv_ic->ic_lastdata = jiffies; 
     310 
     311        // Dispatch the packet to the parent device 
     312        skb->dev = vap->iv_ic->ic_dev; 
     313        (void) dev_queue_xmit(skb); 
     314} 
     315 
    307316/* 
    308317 * Set the direction field and address fields of an outgoing 
    309318 * 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)", 
     
    300303                 * 
    301304                 * Set the M_PWR_SAV bit on skb to allow encap to test for 
    302305                 * adding MORE_DATA bit to wh. 
     306                 * 
     307                 * The 802.11 MAC Spec says we should only set MORE_DATA for  
     308                 * unicast packets when the STA is in PS mode (7.1.3.1.8); 
     309                 * which it isn't. 
    303310                 */ 
    304                 M_PWR_SAV_SET(skb); 
     311                // M_PWR_SAV_SET(skb); 
    305312 
    306313#ifdef ATH_SUPERG_XR 
    307314                /* 
     
    313320                        skb->dev = vap->iv_xrvap->iv_dev; 
    314321                else 
    315322                        skb->dev = vap->iv_dev;         /* XXX? unnecessary */ 
    316 #else 
    317                 skb->dev = vap->iv_dev;         /* XXX? unnecessary */ 
    318323#endif 
    319                 dev_queue_xmit(skb); 
     324                 
     325                ieee80211_parent_queue_xmit(skb); 
    320326        } 
    321327        vap->iv_set_tim(ni, 0); 
    322328} 
     
    356362                                IEEE80211_NODE_SAVEQ_UNLOCK(ni); 
    357363                                if (skb == NULL) 
    358364                                        break; 
    359                                 dev_queue_xmit(skb); 
     365                                ieee80211_parent_queue_xmit(skb); 
    360366                        } 
    361367                } 
    362368        } 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);