Ticket #1315: madwifi-compat-0.9.3-2.6.22.patch

File madwifi-compat-0.9.3-2.6.22.patch, 5.7 kB (added by kelmo, 1 year ago)

proposed update for 0.9.3.2

  • madwifi-0.9.3/ath/if_ath_pci.c

    old new  
    207207 
    208208        pci_set_drvdata(pdev, dev); 
    209209 
     210#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 
     211        if (request_irq(pdev->irq, ath_intr, IRQF_SHARED, dev->name, dev)) { 
     212#else 
    210213        if (request_irq(dev->irq, ath_intr, SA_SHIRQ, dev->name, dev)) { 
     214#endif 
    211215                printk(KERN_WARNING "%s: request_irq failed\n", dev->name); 
    212216                goto bad3; 
    213217        } 
  • madwifi-0.9.3/include/compat.h

    old new  
    130130#define __iomem 
    131131#endif 
    132132 
     133#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) 
     134#include <linux/skbuff.h> 
     135static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) 
     136{ 
     137        return skb->end; 
     138} 
     139 
     140static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb) 
     141{ 
     142        return skb->tail; 
     143} 
     144 
     145static inline void skb_set_network_header(struct sk_buff *skb, const int offset) 
     146{ 
     147        skb->nh.raw = skb->data + offset; 
     148} 
     149 
     150static inline void skb_reset_network_header(struct sk_buff *skb) 
     151{ 
     152        skb->nh.raw = skb->data; 
     153} 
     154 
     155static inline unsigned char *skb_mac_header(const struct sk_buff *skb) 
     156{ 
     157        return skb->mac.raw; 
     158} 
     159 
     160static inline void skb_reset_mac_header(struct sk_buff *skb) 
     161{ 
     162        skb->mac.raw = skb->data; 
     163} 
     164#endif 
     165 
    133166#endif /* __KERNEL__ */ 
    134167 
    135168#endif /* _ATH_COMPAT_H_ */ 
  • madwifi-0.9.3/net80211/ieee80211_input.c

    old new  
    10391039                         * incoming fragments 
    10401040                         * XXX 4-address/QoS frames? 
    10411041                         */ 
    1042                         else if (skb->end - skb->head < ni->ni_vap->iv_dev->mtu + 
    1043                                  hdrlen) { 
     1042                        else if ((skb_end_pointer(skb) - skb->head) < 
     1043                                 (ni->ni_vap->iv_dev->mtu + hdrlen)) { 
    10441044                                ni->ni_rxfrag = skb_copy_expand(skb, 0, 
    10451045                                        (ni->ni_vap->iv_dev->mtu + hdrlen) - 
    1046                                         (skb->end - skb->head), GFP_ATOMIC); 
     1046                                        (skb_end_pointer(skb) - skb->head), 
     1047                                        GFP_ATOMIC); 
    10471048                                dev_kfree_skb(skb); 
    10481049                        } 
    10491050                } 
     
    10571058                         * we've verified that before 
    10581059                         */ 
    10591060                        /* Copy current fragment at end of previous one */ 
    1060                         memcpy(ni->ni_rxfrag->tail
     1061                        memcpy(skb_tail_pointer(ni->ni_rxfrag)
    10611062                               skb->data + hdrlen, skb->len - hdrlen); 
    10621063                        /* Update tail and length */ 
    10631064                        skb_put(ni->ni_rxfrag, skb->len - hdrlen); 
     
    11271128                } 
    11281129                if (skb1 != NULL) { 
    11291130                        skb1->dev = dev; 
    1130                         skb1->mac.raw = skb1->data; 
    1131                         skb1->nh.raw = skb1->data + sizeof(struct ether_header); 
     1131 
     1132                        skb_reset_mac_header(skb1); 
     1133                        skb_set_network_header(skb1, sizeof(struct ether_header)); 
     1134 
    11321135                        skb1->protocol = __constant_htons(ETH_P_802_2); 
    11331136                        /* XXX insert vlan tag before queue it? */ 
    11341137                        dev_queue_xmit(skb1); 
     
    22502253                if (skb1 == NULL) 
    22512254                        return; 
    22522255                skb1->dev = dev; 
    2253                 skb1->mac.raw = skb1->data; 
     2256                skb_reset_mac_header(skb1); 
     2257                 
    22542258                skb1->ip_summed = CHECKSUM_NONE; 
    22552259                skb1->pkt_type = PACKET_OTHERHOST; 
    22562260                skb1->protocol = __constant_htons(0x0019);  /* ETH_P_80211_RAW */ 
     
    25252529         
    25262530        skb->dev = dev; 
    25272531        skb->protocol = eth_type_trans(skb, dev); 
    2528         skb->mac.raw = skb->data; 
     2532        skb_reset_mac_header(skb); 
     2533 
    25292534        ieee80211_deliver_data(ni, skb); 
    25302535        return; 
    25312536} 
     
    36913696{ 
    36923697        struct ethhdr *eth; 
    36933698         
    3694         skb->mac.raw=skb->data
     3699        skb_reset_mac_header(skb)
    36953700        skb_pull(skb, ETH_HLEN); 
    36963701        /* 
    36973702         * NB: mac.ethernet is replaced in 2.6.9 by eth_hdr but 
    36983703         *     since that's an inline and not a define there's 
    36993704         *     no easy way to do this cleanly. 
    37003705         */ 
    3701         eth = (struct ethhdr *)skb->mac.raw
     3706        eth = (struct ethhdr *)skb_mac_header(skb)
    37023707         
    37033708        if (*eth->h_dest & 1) 
    37043709                if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0) 
  • madwifi-0.9.3/net80211/ieee80211_monitor.c

    old new  
    373373                if (vap->iv_monitor_txf_len && tx) { 
    374374                        /* truncate transmit feedback packets */ 
    375375                        skb_trim(skb1, vap->iv_monitor_txf_len); 
    376                         skb1->nh.raw = skb1->data
     376                        skb_reset_network_header(skb1)
    377377                } 
    378378                switch (vap->iv_dev->type) { 
    379379                case ARPHRD_IEEE80211: 
     
    555555                                skb_trim(skb1, skb1->len - IEEE80211_CRC_LEN); 
    556556                        } 
    557557                        skb1->dev = dev; /* NB: deliver to wlanX */ 
    558                         skb1->mac.raw = skb1->data; 
     558                        skb_reset_mac_header(skb1); 
     559 
    559560                        skb1->ip_summed = CHECKSUM_NONE; 
    560561                        skb1->pkt_type = pkttype; 
    561562                        skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ 
  • madwifi-0.9.3/patches/2.6/Kconfig

    old new  
    33 
    44config ATHEROS 
    55        tristate "Atheros PCI/Cardbus cards" 
    6         depends on PCI && NET_RADIO 
     6        depends on PCI && (NET_RADIO || WIRELESS_EXT) 
    77       ---help--- 
    88          Say Y here if you intend to attach an Atheros Cardbus or PCI 
    99          wireless Ethernet networking card to your computer.  This