Ticket #1315: madwifi-0.9.3_Linux-2.6.22-rc1.diff

File madwifi-0.9.3_Linux-2.6.22-rc1.diff, 3.6 kB (added by GrimRC, 5 years ago)

patch to make madwifi 0.9.3 work with Linux 2.6.22-rc1

  • 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(dev->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 
     215 
    211216                printk(KERN_WARNING "%s: request_irq failed\n", dev->name); 
    212217                goto bad3; 
    213218        } 
  • madwifi-0.9.3/net80211/ieee80211_input.c

    old new  
    11271127                } 
    11281128                if (skb1 != NULL) { 
    11291129                        skb1->dev = dev; 
     1130 
     1131#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 
     1132                        skb1->mac_header = skb1->data; 
     1133                        skb1->network_header = skb1->data + sizeof(struct ether_header); 
     1134#else 
    11301135                        skb1->mac.raw = skb1->data; 
    11311136                        skb1->nh.raw = skb1->data + sizeof(struct ether_header); 
     1137#endif 
     1138 
    11321139                        skb1->protocol = __constant_htons(ETH_P_802_2); 
    11331140                        /* XXX insert vlan tag before queue it? */ 
    11341141                        dev_queue_xmit(skb1); 
     
    22502257                if (skb1 == NULL) 
    22512258                        return; 
    22522259                skb1->dev = dev; 
     2260 
     2261#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 
     2262                skb1->mac_header = skb1->data; 
     2263#else 
    22532264                skb1->mac.raw = skb1->data; 
     2265#endif 
     2266 
    22542267                skb1->ip_summed = CHECKSUM_NONE; 
    22552268                skb1->pkt_type = PACKET_OTHERHOST; 
    22562269                skb1->protocol = __constant_htons(0x0019);  /* ETH_P_80211_RAW */ 
     
    25252538         
    25262539        skb->dev = dev; 
    25272540        skb->protocol = eth_type_trans(skb, dev); 
     2541 
     2542#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 
     2543        skb->mac_header = skb->data; 
     2544#else 
    25282545        skb->mac.raw = skb->data; 
     2546#endif 
     2547 
    25292548        ieee80211_deliver_data(ni, skb); 
    25302549        return; 
    25312550} 
     
    36903709ath_eth_type_trans(struct sk_buff *skb, struct net_device *dev) 
    36913710{ 
    36923711        struct ethhdr *eth; 
    3693          
    3694         skb->mac.raw=skb->data; 
     3712 
     3713#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)         
     3714        skb->mac_header = skb->data; 
     3715#else 
     3716        skb->mac.raw = skb->data; 
     3717#endif 
     3718 
    36953719        skb_pull(skb, ETH_HLEN); 
    36963720        /* 
    36973721         * NB: mac.ethernet is replaced in 2.6.9 by eth_hdr but 
    36983722         *     since that's an inline and not a define there's 
    36993723         *     no easy way to do this cleanly. 
    37003724         */ 
     3725 
     3726#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 
     3727        eth = (struct ethhdr *)skb->mac_header; 
     3728#else 
    37013729        eth = (struct ethhdr *)skb->mac.raw; 
     3730#endif 
    37023731         
    37033732        if (*eth->h_dest & 1) 
    37043733                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 
     377#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 
     378                        skb1->network_header = skb1->data; 
     379#else 
    376380                        skb1->nh.raw = skb1->data; 
     381#endif 
     382 
    377383                } 
    378384                switch (vap->iv_dev->type) { 
    379385                case ARPHRD_IEEE80211: 
     
    555561                                skb_trim(skb1, skb1->len - IEEE80211_CRC_LEN); 
    556562                        } 
    557563                        skb1->dev = dev; /* NB: deliver to wlanX */ 
     564 
     565#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 
     566                        skb1->mac_header = skb1->data; 
     567#else 
    558568                        skb1->mac.raw = skb1->data; 
     569#endif 
     570 
    559571                        skb1->ip_summed = CHECKSUM_NONE; 
    560572                        skb1->pkt_type = pkttype; 
    561573                        skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */