add madwifi changeset 2484 (node refcounting patch) - i will resync with madwifi...
[openwrt/svn-archive/archive.git] / package / madwifi / patches / 124-node_unref_r2484.patch
1 Index: madwifi/net80211/ieee80211_wireless.c
2 ===================================================================
3 --- madwifi/net80211/ieee80211_wireless.c (revision 2482)
4 +++ madwifi/net80211/ieee80211_wireless.c (revision 2484)
5 @@ -1102,5 +1102,4 @@
6 for (i = 0; i < number; i++) {
7 ni = ieee80211_find_node(nt, &vap->iv_spy.mac[i * IEEE80211_ADDR_LEN]);
8 - /* TODO: free node ? */
9 /* check we are associated w/ this vap */
10 if (ni && (ni->ni_vap == vap)) {
11 @@ -1114,4 +1113,5 @@
12 spy_stat[i].updated = IW_QUAL_ALL_INVALID;
13 }
14 + ieee80211_unref_node(&ni);
15 }
16
17 @@ -3191,4 +3191,5 @@
18 if (ik->ik_keylen > sizeof(ik->ik_keydata))
19 return -E2BIG;
20 +
21 kix = ik->ik_keyix;
22 if (kix == IEEE80211_KEYIX_NONE) {
23 @@ -3214,4 +3215,5 @@
24 ik->ik_flags |= IEEE80211_KEY_GROUP; /* XXX */
25 }
26 +
27 error = 0;
28 flags = ik->ik_flags & IEEE80211_KEY_COMMON;
29 @@ -3228,5 +3230,5 @@
30 memcpy(wk->wk_key, ik->ik_keydata, ik->ik_keylen);
31 if (!ieee80211_crypto_setkey(vap, wk,
32 - ni != NULL ? ni->ni_macaddr : ik->ik_macaddr, ni))
33 + (ni != NULL) ? ni->ni_macaddr : ik->ik_macaddr, ni))
34 error = -EIO;
35 else if ((ik->ik_flags & IEEE80211_KEY_DEFAULT))
36 @@ -3234,4 +3236,5 @@
37 } else
38 error = -ENXIO;
39 +
40 ieee80211_key_update_end(vap);
41 if (ni != NULL)
42 Index: madwifi/net80211/ieee80211_output.c
43 ===================================================================
44 --- madwifi/net80211/ieee80211_output.c (revision 2438)
45 +++ madwifi/net80211/ieee80211_output.c (revision 2484)
46 @@ -269,4 +269,5 @@
47 */
48 ieee80211_pwrsave(ni, skb);
49 + ieee80211_unref_node(&ni);
50 return 0;
51 }
52 @@ -283,5 +284,5 @@
53 struct sk_buff *skb1;
54 ni = ieee80211_find_txnode(vap->iv_xrvap, eh->ether_dhost);
55 - skb1 = skb_clone(skb,GFP_ATOMIC);
56 + skb1 = skb_clone(skb, GFP_ATOMIC);
57 if (skb1) {
58 cb = (struct ieee80211_cb *) skb1->cb;
59 Index: madwifi/ath/if_ath.c
60 ===================================================================
61 --- madwifi/ath/if_ath.c (revision 2482)
62 +++ madwifi/ath/if_ath.c (revision 2484)
63 @@ -8111,14 +8111,13 @@
64 /* Depending on the sequence of bringing up devices
65 * it's possible the rates of the root bss isn't
66 - * filled yet.
67 - */
68 - if (vap->iv_ic->ic_newassoc != NULL &&
69 - wds_ni->ni_rates.rs_nrates != 0) {
70 + * filled yet. */
71 + if ((vap->iv_ic->ic_newassoc != NULL) &&
72 + (wds_ni->ni_rates.rs_nrates != 0)) {
73 /* Fill in the rates based on our own rates
74 * we rely on the rate selection mechanism
75 - * to find out which rates actually work!
76 - */
77 + * to find out which rates actually work! */
78 vap->iv_ic->ic_newassoc(wds_ni, 1);
79 }
80 + ieee80211_unref_node(&wds_ni);
81 }
82 break;