Changeset 3621

Show
Ignore:
Timestamp:
05/10/08 08:03:52 (8 months ago)
Author:
mentor
Message:

Only deliver frames to VAPs that are running.

This includes the reinstatement of the ieee80211_input_all function as this functionality should live in the net80211 layer. Unfortunately the code for this is a tad on the ugly side.

Thanks to OpenWRT/nbd: https://dev.openwrt.org/log/trunk/package/madwifi/patches/334-input.patch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • madwifi/trunk/ath/if_ath.c

    r3620 r3621  
    67966796                        ieee80211_unref_node(&ni); 
    67976797                } else { 
    6798                         struct ieee80211vap *vap; 
    6799                         struct sk_buff *tskb; 
    6800                         /* Create a new SKB copy for each VAP except the last 
    6801                          * one, which gets the original SKB. */ 
    6802                         TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { 
    6803                                 if (vap == TAILQ_LAST(&ic->ic_vaps, 
    6804                                                         ieee80211vap_headtype)) 
    6805                                         tskb = skb; 
    6806                                 else 
    6807                                         tskb = skb_copy(skb, GFP_ATOMIC); 
    6808  
    6809                                 if (!tskb) 
    6810                                         /* XXX: Brilliant OOM handling. */ 
    6811                                         vap->iv_devstats.tx_dropped++; 
    6812                                 else 
    6813                                         type = ieee80211_input(vap, NULL, skb, 
    6814                                                         rs->rs_rssi, bf->bf_tsf); 
    6815                         } 
    6816                 } 
     6798                        type = ieee80211_input_all(ic, skb, 
     6799                                        rs->rs_rssi, bf->bf_tsf); 
     6800                } 
     6801                skb = NULL; 
    68176802 
    68186803                if (sc->sc_diversity) { 
  • madwifi/trunk/net80211/ieee80211_input.c

    r3595 r3621  
    195195 */ 
    196196int 
    197 ieee80211_input(struct ieee80211vap * vap, struct ieee80211_node *ni_or_null, 
     197ieee80211_input(struct ieee80211vap *vap, struct ieee80211_node *ni_or_null, 
    198198        struct sk_buff *skb, int rssi, u_int64_t rtsf) 
    199199{ 
     
    209209#endif 
    210210        int hdrspace; 
    211         u_int8_t dir, type, subtype; 
     211        u_int8_t dir, type = -1, subtype; 
    212212        u_int8_t *bssid; 
    213213        u_int16_t rxseq; 
     214 
     215        if ((vap->iv_dev->flags & (IFF_RUNNING | IFF_UP)) != 
     216                        (IFF_RUNNING | IFF_UP)) 
     217                goto out; 
    214218 
    215219        /* Initialize ni as in the previous API. */ 
     
    223227        KASSERT(ni != NULL, ("null node")); 
    224228        ni->ni_inact = ni->ni_inact_reload; 
    225         type = -1;                      /* undefined */ 
    226229         
    227230        /* In monitor mode, send everything directly to bpf. 
     
    846849#undef HAS_SEQ 
    847850} 
     851 
    848852EXPORT_SYMBOL(ieee80211_input); 
    849  
     853/*  
     854 * Context: softIRQ (tasklet)  
     855 */  
     856int  
     857ieee80211_input_all(struct ieee80211com *ic,  
     858                struct sk_buff *skb, int rssi, u_int64_t rtsf)  
     859{  
     860        struct ieee80211vap *vap, *next_vap;  
     861        struct sk_buff *tskb = NULL; 
     862        int type = -1;  /* Used to determine when to blinks LEDs. */ 
     863 
     864        /* Create a new SKB copy for each VAP except the last 
     865         * one, which gets the original SKB. */ 
     866        vap = TAILQ_FIRST(&ic->ic_vaps); 
     867        while (vap) { 
     868                for (next_vap = TAILQ_NEXT(vap, iv_next); next_vap; 
     869                                next_vap = TAILQ_NEXT(next_vap, iv_next)) { 
     870                        if ((next_vap->iv_dev->flags & (IFF_RUNNING | IFF_UP)) 
     871                                        == (IFF_RUNNING | IFF_UP)) 
     872                                break; 
     873                } 
     874 
     875                if (!next_vap) { 
     876                        tskb = skb; 
     877                        skb = NULL; 
     878                } else 
     879                        tskb = skb_copy(skb, GFP_ATOMIC); 
     880 
     881                if (!tskb) 
     882                        /* XXX: Brilliant OOM handling. */ 
     883                        vap->iv_devstats.tx_dropped++; 
     884                else 
     885                        type = ieee80211_input(vap, NULL, tskb, rssi, rtsf); 
     886 
     887                vap = next_vap; 
     888        }; 
     889 
     890        ieee80211_dev_kfree_skb(&skb); 
     891        return type;  
     892}  
     893EXPORT_SYMBOL(ieee80211_input_all);  
    850894 
    851895/* 
  • madwifi/trunk/net80211/ieee80211_proto.h

    r3501 r3621  
    6666struct ieee80211_channel *ieee80211_doth_findchan(struct ieee80211vap *, u_int8_t); 
    6767int ieee80211_input(struct ieee80211vap *, struct ieee80211_node *, struct sk_buff *, int, u_int64_t); 
     68int ieee80211_input_all(struct ieee80211com *, struct sk_buff *, int, u_int64_t); 
    6869int ieee80211_setup_rates(struct ieee80211_node *, const u_int8_t *, 
    6970        const u_int8_t *, int);