1 Index: madwifi-trunk-r3776/ath/if_ath.c
2 ===================================================================
3 --- madwifi-trunk-r3776.orig/ath/if_ath.c 2008-07-17 02:23:00.000000000 +0200
4 +++ madwifi-trunk-r3776/ath/if_ath.c 2008-07-17 02:28:06.000000000 +0200
6 struct ath_softc *sc = dev->priv;
7 struct ieee80211_node *ni = NULL;
8 struct ath_buf *bf = NULL;
9 - struct ether_header *eh;
17 + struct ether_header *eh;
19 struct ieee80211com *ic = &sc->sc_ic;
20 struct ath_txq *txq = NULL;
21 Index: madwifi-trunk-r3776/net80211/ieee80211_output.c
22 ===================================================================
23 --- madwifi-trunk-r3776.orig/net80211/ieee80211_output.c 2008-07-17 00:21:29.000000000 +0200
24 +++ madwifi-trunk-r3776/net80211/ieee80211_output.c 2008-07-17 02:35:10.000000000 +0200
27 if (vap->iv_xrvap && (ni == vap->iv_bss) &&
28 vap->iv_xrvap->iv_sta_assoc) {
29 - struct sk_buff *skb1 = skb_copy(skb, GFP_ATOMIC);
30 + struct sk_buff *skb1 = skb_clone(skb, GFP_ATOMIC);
32 memset(SKB_CB(skb1), 0, sizeof(struct ieee80211_cb));
33 #ifdef IEEE80211_DEBUG_REFCNT
35 struct ieee80211_key *key, struct sk_buff *skb, int ismulticast)
37 /* XXX pre-calculate per node? */
38 - int need_headroom = LLC_SNAPFRAMELEN + hdrsize + IEEE80211_ADDR_LEN;
39 + int need_headroom = LLC_SNAPFRAMELEN + hdrsize;
40 int need_tailroom = 0;
42 int isff = ATH_FF_MAGIC_PRESENT(skb);
43 @@ -603,109 +603,56 @@
44 need_tailroom += cip->ic_miclen;
47 - if (skb_shared(skb)) {
48 - /* Take our own reference to the node in the clone */
49 - ieee80211_ref_node(SKB_NI(skb));
50 - /* Unshare the node, decrementing users in the old skb */
51 - skb = skb_unshare(skb, GFP_ATOMIC);
52 + need_headroom -= skb_headroom(skb);
54 + need_tailroom -= skb_tailroom(skb2);
56 + need_tailroom -= skb_tailroom(skb);
58 + if (need_headroom < 0)
60 + if (need_tailroom < 0)
63 + if (skb_cloned(skb) || (need_headroom > 0) ||
64 + (!isff && (need_tailroom > 0))) {
66 + if (pskb_expand_head(skb, need_headroom, need_tailroom, GFP_ATOMIC)) {
67 + IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
68 + "%s: cannot expand storage (tail)\n", __func__);
76 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
77 - "%s: cannot unshare for encapsulation\n",
79 - vap->iv_stats.is_tx_nobuf++;
80 - ieee80211_dev_kfree_skb(&skb2);
84 + inter_headroom -= skb_headroom(skb2);
85 + if (inter_headroom < 0)
87 + if ((skb_cloned(skb2) ||
88 + (inter_headroom > 0) || (need_tailroom > 0))) {
90 - /* first skb header */
91 - if (skb_headroom(skb) < need_headroom) {
92 - struct sk_buff *tmp = skb;
93 - skb = skb_realloc_headroom(skb, need_headroom);
95 + if (pskb_expand_head(skb2, inter_headroom,
96 + need_tailroom, GFP_ATOMIC)) {
97 IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
98 - "%s: cannot expand storage (head1)\n",
100 - vap->iv_stats.is_tx_nobuf++;
101 - ieee80211_dev_kfree_skb(&skb2);
104 - ieee80211_skb_copy_noderef(tmp, skb);
105 - ieee80211_dev_kfree_skb(&tmp);
106 - /* NB: cb[] area was copied, but not next ptr. must do that
107 - * prior to return on success. */
110 - /* second skb with header and tail adjustments possible */
111 - if (skb_tailroom(skb2) < need_tailroom) {
113 - if (inter_headroom > skb_headroom(skb2))
114 - n = inter_headroom - skb_headroom(skb2);
115 - if (pskb_expand_head(skb2, n,
116 - need_tailroom - skb_tailroom(skb2), GFP_ATOMIC)) {
117 - ieee80211_dev_kfree_skb(&skb2);
118 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
119 - "%s: cannot expand storage (tail2)\n",
121 - vap->iv_stats.is_tx_nobuf++;
122 - /* this shouldn't happen, but don't send first ff either */
123 - ieee80211_dev_kfree_skb(&skb);
124 + "%s: cannot expand storage (tail)\n", __func__);
127 - } else if (skb_headroom(skb2) < inter_headroom) {
128 - struct sk_buff *tmp = skb2;
130 - skb2 = skb_realloc_headroom(skb2, inter_headroom);
131 - if (skb2 == NULL) {
132 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
133 - "%s: cannot expand storage (head2)\n",
135 - vap->iv_stats.is_tx_nobuf++;
136 - /* this shouldn't happen, but don't send first ff either */
137 - ieee80211_dev_kfree_skb(&skb);
140 - ieee80211_skb_copy_noderef(tmp, skb);
141 - ieee80211_dev_kfree_skb(&tmp);
149 #endif /* ATH_SUPERG_FF */
151 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
152 - "%s: cannot unshare for encapsulation\n", __func__);
153 - vap->iv_stats.is_tx_nobuf++;
154 - } else if (skb_tailroom(skb) < need_tailroom) {
156 - if (need_headroom > skb_headroom(skb))
157 - n = need_headroom - skb_headroom(skb);
158 - if (pskb_expand_head(skb, n, need_tailroom -
159 - skb_tailroom(skb), GFP_ATOMIC)) {
160 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
161 - "%s: cannot expand storage (tail)\n", __func__);
162 - vap->iv_stats.is_tx_nobuf++;
163 - ieee80211_dev_kfree_skb(&skb);
165 - } else if (skb_headroom(skb) < need_headroom) {
166 - struct sk_buff *tmp = skb;
167 - skb = skb_realloc_headroom(skb, need_headroom);
168 - /* Increment reference count after copy */
170 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
171 - "%s: cannot expand storage (head)\n", __func__);
172 - vap->iv_stats.is_tx_nobuf++;
174 - ieee80211_skb_copy_noderef(tmp, skb);
175 - ieee80211_dev_kfree_skb(&tmp);
181 + vap->iv_stats.is_tx_nobuf++;
182 + ieee80211_dev_kfree_skb(&skb);
183 +#ifdef ATH_SUPERG_FF
185 + ieee80211_dev_kfree_skb(&skb2);
190 #define KEY_UNDEFINED(k) ((k).wk_cipher == &ieee80211_cipher_none)
191 Index: madwifi-trunk-r3776/net80211/ieee80211_input.c
192 ===================================================================
193 --- madwifi-trunk-r3776.orig/net80211/ieee80211_input.c 2008-07-17 02:20:52.000000000 +0200
194 +++ madwifi-trunk-r3776/net80211/ieee80211_input.c 2008-07-17 02:30:28.000000000 +0200
196 /* ether_type must be length as FF frames are always LLC/SNAP encap'd */
197 frame_len = ntohs(eh_tmp->ether_type);
199 - skb1 = skb_copy(skb, GFP_ATOMIC);
200 + skb1 = skb_clone(skb, GFP_ATOMIC);
203 ieee80211_skb_copy_noderef(skb, skb1);
204 @@ -1118,7 +1118,7 @@
206 if (ETHER_IS_MULTICAST(eh->ether_dhost) && !netif_queue_stopped(dev)) {
207 /* Create a SKB for the BSS to send out. */
208 - skb1 = skb_copy(skb, GFP_ATOMIC);
209 + skb1 = skb_clone(skb, GFP_ATOMIC);
211 SKB_NI(skb1) = ieee80211_ref_node(vap->iv_bss);
213 @@ -2265,7 +2265,7 @@
214 if (filter_type && ((vap->app_filter & filter_type) == filter_type)) {
215 struct sk_buff *skb1;
217 - skb1 = skb_copy(skb, GFP_ATOMIC);
218 + skb1 = skb_clone(skb, GFP_ATOMIC);
221 /* We duplicate the reference after skb_copy */