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) |
|---|
-
madwifi-0.9.3/ath/if_ath_pci.c
old new 207 207 208 208 pci_set_drvdata(pdev, dev); 209 209 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 210 213 if (request_irq(dev->irq, ath_intr, SA_SHIRQ, dev->name, dev)) { 214 #endif 211 215 printk(KERN_WARNING "%s: request_irq failed\n", dev->name); 212 216 goto bad3; 213 217 } -
madwifi-0.9.3/include/compat.h
old new 130 130 #define __iomem 131 131 #endif 132 132 133 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) 134 #include <linux/skbuff.h> 135 static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) 136 { 137 return skb->end; 138 } 139 140 static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb) 141 { 142 return skb->tail; 143 } 144 145 static inline void skb_set_network_header(struct sk_buff *skb, const int offset) 146 { 147 skb->nh.raw = skb->data + offset; 148 } 149 150 static inline void skb_reset_network_header(struct sk_buff *skb) 151 { 152 skb->nh.raw = skb->data; 153 } 154 155 static inline unsigned char *skb_mac_header(const struct sk_buff *skb) 156 { 157 return skb->mac.raw; 158 } 159 160 static inline void skb_reset_mac_header(struct sk_buff *skb) 161 { 162 skb->mac.raw = skb->data; 163 } 164 #endif 165 133 166 #endif /* __KERNEL__ */ 134 167 135 168 #endif /* _ATH_COMPAT_H_ */ -
madwifi-0.9.3/net80211/ieee80211_input.c
old new 1039 1039 * incoming fragments 1040 1040 * XXX 4-address/QoS frames? 1041 1041 */ 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)) { 1044 1044 ni->ni_rxfrag = skb_copy_expand(skb, 0, 1045 1045 (ni->ni_vap->iv_dev->mtu + hdrlen) - 1046 (skb->end - skb->head), GFP_ATOMIC); 1046 (skb_end_pointer(skb) - skb->head), 1047 GFP_ATOMIC); 1047 1048 dev_kfree_skb(skb); 1048 1049 } 1049 1050 } … … 1057 1058 * we've verified that before 1058 1059 */ 1059 1060 /* Copy current fragment at end of previous one */ 1060 memcpy( ni->ni_rxfrag->tail,1061 memcpy(skb_tail_pointer(ni->ni_rxfrag), 1061 1062 skb->data + hdrlen, skb->len - hdrlen); 1062 1063 /* Update tail and length */ 1063 1064 skb_put(ni->ni_rxfrag, skb->len - hdrlen); … … 1127 1128 } 1128 1129 if (skb1 != NULL) { 1129 1130 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 1132 1135 skb1->protocol = __constant_htons(ETH_P_802_2); 1133 1136 /* XXX insert vlan tag before queue it? */ 1134 1137 dev_queue_xmit(skb1); … … 2250 2253 if (skb1 == NULL) 2251 2254 return; 2252 2255 skb1->dev = dev; 2253 skb1->mac.raw = skb1->data; 2256 skb_reset_mac_header(skb1); 2257 2254 2258 skb1->ip_summed = CHECKSUM_NONE; 2255 2259 skb1->pkt_type = PACKET_OTHERHOST; 2256 2260 skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ … … 2525 2529 2526 2530 skb->dev = dev; 2527 2531 skb->protocol = eth_type_trans(skb, dev); 2528 skb->mac.raw = skb->data; 2532 skb_reset_mac_header(skb); 2533 2529 2534 ieee80211_deliver_data(ni, skb); 2530 2535 return; 2531 2536 } … … 3691 3696 { 3692 3697 struct ethhdr *eth; 3693 3698 3694 skb ->mac.raw=skb->data;3699 skb_reset_mac_header(skb); 3695 3700 skb_pull(skb, ETH_HLEN); 3696 3701 /* 3697 3702 * NB: mac.ethernet is replaced in 2.6.9 by eth_hdr but 3698 3703 * since that's an inline and not a define there's 3699 3704 * no easy way to do this cleanly. 3700 3705 */ 3701 eth = (struct ethhdr *)skb ->mac.raw;3706 eth = (struct ethhdr *)skb_mac_header(skb); 3702 3707 3703 3708 if (*eth->h_dest & 1) 3704 3709 if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0) -
madwifi-0.9.3/net80211/ieee80211_monitor.c
old new 373 373 if (vap->iv_monitor_txf_len && tx) { 374 374 /* truncate transmit feedback packets */ 375 375 skb_trim(skb1, vap->iv_monitor_txf_len); 376 skb 1->nh.raw = skb1->data;376 skb_reset_network_header(skb1); 377 377 } 378 378 switch (vap->iv_dev->type) { 379 379 case ARPHRD_IEEE80211: … … 555 555 skb_trim(skb1, skb1->len - IEEE80211_CRC_LEN); 556 556 } 557 557 skb1->dev = dev; /* NB: deliver to wlanX */ 558 skb1->mac.raw = skb1->data; 558 skb_reset_mac_header(skb1); 559 559 560 skb1->ip_summed = CHECKSUM_NONE; 560 561 skb1->pkt_type = pkttype; 561 562 skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ -
madwifi-0.9.3/patches/2.6/Kconfig
old new 3 3 4 4 config ATHEROS 5 5 tristate "Atheros PCI/Cardbus cards" 6 depends on PCI && NET_RADIO6 depends on PCI && (NET_RADIO || WIRELESS_EXT) 7 7 ---help--- 8 8 Say Y here if you intend to attach an Atheros Cardbus or PCI 9 9 wireless Ethernet networking card to your computer. This
