4 struct ath_softc *sc = dev->priv;
5 struct ieee80211_node *ni = NULL;
6 struct ath_buf *bf = NULL;
7 - struct ether_header *eh;
15 + struct ether_header *eh;
17 struct ieee80211com *ic = &sc->sc_ic;
18 struct ath_txq *txq = NULL;
19 --- a/net80211/ieee80211_output.c
20 +++ b/net80211/ieee80211_output.c
23 if (vap->iv_xrvap && (ni == vap->iv_bss) &&
24 vap->iv_xrvap->iv_sta_assoc) {
25 - struct sk_buff *skb1 = skb_copy(skb, GFP_ATOMIC);
26 + struct sk_buff *skb1 = skb_clone(skb, GFP_ATOMIC);
28 memset(SKB_CB(skb1), 0, sizeof(struct ieee80211_cb));
29 #ifdef IEEE80211_DEBUG_REFCNT
31 struct ieee80211_key *key, struct sk_buff *skb, int ismulticast)
33 /* XXX pre-calculate per node? */
34 - int need_headroom = LLC_SNAPFRAMELEN + hdrsize + IEEE80211_ADDR_LEN;
35 + int need_headroom = LLC_SNAPFRAMELEN + hdrsize;
36 int need_tailroom = 0;
38 int isff = ATH_FF_MAGIC_PRESENT(skb);
39 @@ -603,109 +603,56 @@
40 need_tailroom += cip->ic_miclen;
43 - if (skb_shared(skb)) {
44 - /* Take our own reference to the node in the clone */
45 - ieee80211_ref_node(SKB_NI(skb));
46 - /* Unshare the node, decrementing users in the old skb */
47 - skb = skb_unshare(skb, GFP_ATOMIC);
48 + need_headroom -= skb_headroom(skb);
50 + need_tailroom -= skb_tailroom(skb2);
52 + need_tailroom -= skb_tailroom(skb);
54 + if (need_headroom < 0)
56 + if (need_tailroom < 0)
59 + if (skb_cloned(skb) || (need_headroom > 0) ||
60 + (!isff && (need_tailroom > 0))) {
62 + if (pskb_expand_head(skb, need_headroom, need_tailroom, GFP_ATOMIC)) {
63 + IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
64 + "%s: cannot expand storage (tail)\n", __func__);
72 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
73 - "%s: cannot unshare for encapsulation\n",
75 - vap->iv_stats.is_tx_nobuf++;
76 - ieee80211_dev_kfree_skb(&skb2);
80 + inter_headroom -= skb_headroom(skb2);
81 + if (inter_headroom < 0)
83 + if ((skb_cloned(skb2) ||
84 + (inter_headroom > 0) || (need_tailroom > 0))) {
86 - /* first skb header */
87 - if (skb_headroom(skb) < need_headroom) {
88 - struct sk_buff *tmp = skb;
89 - skb = skb_realloc_headroom(skb, need_headroom);
91 + if (pskb_expand_head(skb2, inter_headroom,
92 + need_tailroom, GFP_ATOMIC)) {
93 IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
94 - "%s: cannot expand storage (head1)\n",
96 - vap->iv_stats.is_tx_nobuf++;
97 - ieee80211_dev_kfree_skb(&skb2);
100 - ieee80211_skb_copy_noderef(tmp, skb);
101 - ieee80211_dev_kfree_skb(&tmp);
102 - /* NB: cb[] area was copied, but not next ptr. must do that
103 - * prior to return on success. */
106 - /* second skb with header and tail adjustments possible */
107 - if (skb_tailroom(skb2) < need_tailroom) {
109 - if (inter_headroom > skb_headroom(skb2))
110 - n = inter_headroom - skb_headroom(skb2);
111 - if (pskb_expand_head(skb2, n,
112 - need_tailroom - skb_tailroom(skb2), GFP_ATOMIC)) {
113 - ieee80211_dev_kfree_skb(&skb2);
114 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
115 - "%s: cannot expand storage (tail2)\n",
117 - vap->iv_stats.is_tx_nobuf++;
118 - /* this shouldn't happen, but don't send first ff either */
119 - ieee80211_dev_kfree_skb(&skb);
120 + "%s: cannot expand storage (tail)\n", __func__);
123 - } else if (skb_headroom(skb2) < inter_headroom) {
124 - struct sk_buff *tmp = skb2;
126 - skb2 = skb_realloc_headroom(skb2, inter_headroom);
127 - if (skb2 == NULL) {
128 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
129 - "%s: cannot expand storage (head2)\n",
131 - vap->iv_stats.is_tx_nobuf++;
132 - /* this shouldn't happen, but don't send first ff either */
133 - ieee80211_dev_kfree_skb(&skb);
136 - ieee80211_skb_copy_noderef(tmp, skb);
137 - ieee80211_dev_kfree_skb(&tmp);
145 #endif /* ATH_SUPERG_FF */
147 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
148 - "%s: cannot unshare for encapsulation\n", __func__);
149 - vap->iv_stats.is_tx_nobuf++;
150 - } else if (skb_tailroom(skb) < need_tailroom) {
152 - if (need_headroom > skb_headroom(skb))
153 - n = need_headroom - skb_headroom(skb);
154 - if (pskb_expand_head(skb, n, need_tailroom -
155 - skb_tailroom(skb), GFP_ATOMIC)) {
156 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
157 - "%s: cannot expand storage (tail)\n", __func__);
158 - vap->iv_stats.is_tx_nobuf++;
159 - ieee80211_dev_kfree_skb(&skb);
161 - } else if (skb_headroom(skb) < need_headroom) {
162 - struct sk_buff *tmp = skb;
163 - skb = skb_realloc_headroom(skb, need_headroom);
164 - /* Increment reference count after copy */
166 - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
167 - "%s: cannot expand storage (head)\n", __func__);
168 - vap->iv_stats.is_tx_nobuf++;
170 - ieee80211_skb_copy_noderef(tmp, skb);
171 - ieee80211_dev_kfree_skb(&tmp);
177 + vap->iv_stats.is_tx_nobuf++;
178 + ieee80211_dev_kfree_skb(&skb);
179 +#ifdef ATH_SUPERG_FF
181 + ieee80211_dev_kfree_skb(&skb2);
186 #define KEY_UNDEFINED(k) ((k).wk_cipher == &ieee80211_cipher_none)
187 --- a/net80211/ieee80211_input.c
188 +++ b/net80211/ieee80211_input.c
190 /* ether_type must be length as FF frames are always LLC/SNAP encap'd */
191 frame_len = ntohs(eh_tmp->ether_type);
193 - skb1 = skb_copy(skb, GFP_ATOMIC);
194 + skb1 = skb_clone(skb, GFP_ATOMIC);
197 ieee80211_skb_copy_noderef(skb, skb1);
198 @@ -1118,7 +1118,7 @@
200 if (ETHER_IS_MULTICAST(eh->ether_dhost) && !netif_queue_stopped(dev)) {
201 /* Create a SKB for the BSS to send out. */
202 - skb1 = skb_copy(skb, GFP_ATOMIC);
203 + skb1 = skb_clone(skb, GFP_ATOMIC);
205 SKB_NI(skb1) = ieee80211_ref_node(vap->iv_bss);
207 @@ -2265,7 +2265,7 @@
208 if (filter_type && ((vap->app_filter & filter_type) == filter_type)) {
209 struct sk_buff *skb1;
211 - skb1 = skb_copy(skb, GFP_ATOMIC);
212 + skb1 = skb_clone(skb, GFP_ATOMIC);
215 /* We duplicate the reference after skb_copy */