Changeset 51

Show
Ignore:
Timestamp:
03/15/03 19:32:10 (6 years ago)
Author:
sam
Message:

Replicated Change 85 by sam@borg_greg on 2003/03/04 18:28:11<<<

o replace skb_realloc_headroom with pskb_expand_head (spied in

the hostap driver); looks to be more efficient

o get data packet rx to work; don't strip the ethernet header

and make things like the other Ethernet drivers

We'll need to revisit the rx logic when we add "monitor mode".

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cvs-import/trunk/wlan/if_ieee80211subr.c

    r49 r51  
    4444#include <linux/skbuff.h> 
    4545#include <linux/netdevice.h> 
     46#include <linux/etherdevice.h> 
    4647#include <linux/random.h> 
    4748 
     
    694695                if (skb != NULL) { 
    695696                        skb->dev = dev; 
    696                         skb->mac.raw = skb->data; 
    697                         skb_pull(skb, sizeof(struct ether_header)); 
    698                         skb->pkt_type = PACKET_OTHERHOST; 
    699                         skb->protocol = __constant_htons(ETH_P_802_2); 
     697                        skb->protocol = eth_type_trans(skb, dev); 
    700698                        netif_rx(skb); 
    701699                } 
     
    847845         * the frame separately and use s/g support in the hardware. 
    848846         */ 
    849         if (skb_headroom(skb) < sizeof(struct ieee80211_frame)) { 
    850                 struct sk_buff *skb2; 
    851                 skb2 = skb_realloc_headroom(skb, sizeof(struct ieee80211_frame)); 
     847        if (skb_headroom(skb) < sizeof(struct ieee80211_frame) && 
     848            pskb_expand_head(skb, sizeof(*wh), 0, GFP_ATOMIC)) { 
    852849                dev_kfree_skb(skb); 
    853                 if (skb2 == NULL) 
    854                         return skb2; 
    855                 skb = skb2; 
     850                return NULL; 
    856851        } 
    857852        wh = (struct ieee80211_frame *) skb_push(skb, sizeof(struct ieee80211_frame));