Changeset 3593
- Timestamp:
- 05/01/08 15:49:09 (8 months ago)
- Files:
-
- madwifi/trunk/ath/if_ath.c (modified) (3 diffs)
- madwifi/trunk/net80211/ieee80211_monitor.c (modified) (2 diffs)
- madwifi/trunk/net80211/ieee80211_monitor.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
madwifi/trunk/ath/if_ath.c
r3579 r3593 6340 6340 struct ath_hal *ah = sc->sc_ah; 6341 6341 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. */ 6351 6347 if (bf->bf_skb != NULL) { 6352 6348 KASSERT(bf->bf_skbaddr, ("bf->bf_skbaddr is 0")); … … 6356 6352 } 6357 6353 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; 6359 6359 int offset = 0; 6360 6360 bf->bf_skb = ath_alloc_skb(size, … … 6368 6368 * Reserve space for the header. 6369 6369 */ 6370 skb_reserve(bf->bf_skb, extra);6370 skb_reserve(bf->bf_skb, IEEE80211_MON_MAXHDROOM); 6371 6371 /* 6372 6372 * Cache-line-align. This is important (for the madwifi/trunk/net80211/ieee80211_monitor.c
r3586 r3593 298 298 * Context: softIRQ (tasklet) 299 299 */ 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 305 300 void 306 301 ieee80211_input_monitor(struct ieee80211com *ic, struct sk_buff *skb, … … 378 373 } 379 374 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, 382 377 0, GFP_ATOMIC); 383 378 else madwifi/trunk/net80211/ieee80211_monitor.h
r3014 r3593 30 30 #define _NET80211_IEEE80211_MONITOR_H_ 31 31 32 #include <net80211/ieee80211_radiotap.h> 33 #include <ah_desc.h> 34 #include <ath/if_athvar.h> 35 32 36 #ifndef ARPHRD_IEEE80211_RADIOTAP 33 37 #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ … … 40 44 #define ATHDESC_HEADER_SIZE 32 41 45 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))) 45 50 46 51 struct ieee80211_phy_params {
