Changeset 3593

Show
Ignore:
Timestamp:
05/01/08 15:49:09 (8 months ago)
Author:
mentor
Message:

Move the maximum monitor headroom definition to a nice header file

Files:

Legend:

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

    r3579 r3593  
    63406340        struct ath_hal *ah = sc->sc_ah; 
    63416341        struct ath_desc *ds = NULL; 
    6342         /* NB: Always use the same size for buffer allocations so that dynamically 
    6343          * adding a monitor mode VAP to a running driver doesn't cause havoc. */ 
    6344         unsigned int extra = A_MAX(sizeof(struct ath_rx_radiotap_header), 
    6345                                    A_MAX(sizeof(struct wlan_ng_prism2_header), 
    6346                                          ATHDESC_HEADER_SIZE)); 
    6347         /* NB: I'm being cautious by unmapping and releasing the SKB every time. 
    6348          * XXX: I could probably keep rolling, but the DMA map/unmap logic doesn't 
    6349          * seem clean enough and cycling the skb through the free function and 
    6350          * slab allocator seems to scrub any un-reset values. */ 
     6342        /* NB: I'm being cautious by unmapping and releasing the SKB every 
     6343         * time. 
     6344         * XXX: I could probably keep rolling, but the DMA map/unmap logic 
     6345         * doesn't seem clean enough and cycling the skb through the free 
     6346         * function and slab allocator seems to scrub any un-reset values. */ 
    63516347        if (bf->bf_skb != NULL) { 
    63526348                KASSERT(bf->bf_skbaddr, ("bf->bf_skbaddr is 0")); 
     
    63566352        } 
    63576353        if (!bf->bf_skb) { 
    6358                 int size = sc->sc_rxbufsize + extra + sc->sc_cachelsz - 1; 
     6354                /* NB: Always use the same size for buffer allocations so that 
     6355                 * dynamically adding a monitor mode VAP to a running driver 
     6356                 * doesn't cause havoc. */ 
     6357                int size = sc->sc_rxbufsize + IEEE80211_MON_MAXHDROOM + 
     6358                        sc->sc_cachelsz - 1; 
    63596359                int offset = 0; 
    63606360                bf->bf_skb = ath_alloc_skb(size,  
     
    63686368                 * Reserve space for the header. 
    63696369                 */ 
    6370                 skb_reserve(bf->bf_skb, extra); 
     6370                skb_reserve(bf->bf_skb, IEEE80211_MON_MAXHDROOM); 
    63716371                /* 
    63726372                 * Cache-line-align.  This is important (for the 
  • madwifi/trunk/net80211/ieee80211_monitor.c

    r3586 r3593  
    298298 * Context: softIRQ (tasklet) 
    299299 */ 
    300 #define MON_PKT_HDRSPACE ((unsigned int)                        \ 
    301         A_MAX(sizeof(struct ath_tx_radiotap_header),            \ 
    302               A_MAX(sizeof(struct wlan_ng_prism2_header),       \ 
    303                             ATHDESC_HEADER_SIZE))) 
    304  
    305300void 
    306301ieee80211_input_monitor(struct ieee80211com *ic, struct sk_buff *skb, 
     
    378373                } 
    379374                 
    380                 if (skb_headroom(skb) < MON_PKT_HDRSPACE
    381                         skb1 = skb_copy_expand(skb, MON_PKT_HDRSPACE
     375                if (skb_headroom(skb) < IEEE80211_MON_MAXHDROOM
     376                        skb1 = skb_copy_expand(skb, IEEE80211_MON_MAXHDROOM
    382377                                        0, GFP_ATOMIC); 
    383378                else 
  • madwifi/trunk/net80211/ieee80211_monitor.h

    r3014 r3593  
    3030#define _NET80211_IEEE80211_MONITOR_H_ 
    3131 
     32#include <net80211/ieee80211_radiotap.h> 
     33#include <ah_desc.h> 
     34#include <ath/if_athvar.h> 
     35 
    3236#ifndef ARPHRD_IEEE80211_RADIOTAP 
    3337#define ARPHRD_IEEE80211_RADIOTAP       803 /* IEEE 802.11 + radiotap header */ 
     
    4044#define ATHDESC_HEADER_SIZE     32 
    4145 
    42 #include <net80211/ieee80211_radiotap.h> 
    43 #include <ah_desc.h> 
    44 #include <ath/if_athvar.h> 
     46#define IEEE80211_MON_MAXHDROOM ((unsigned int)                 \ 
     47        A_MAX(sizeof(struct ath_tx_radiotap_header),            \ 
     48              A_MAX(sizeof(struct wlan_ng_prism2_header),       \ 
     49                            ATHDESC_HEADER_SIZE))) 
    4550 
    4651struct ieee80211_phy_params {