|
Subject: revision 3846 committed Newsgroups: gmane.linux.drivers.madwifi.cvs Date: 2008-08-27 15:58:31 GMT (19 weeks, 2 days, 11 hours and 41 minutes ago)
Project : madwifi
Revision : 3846
Author : proski (Pavel Roskin)
Date : 2008-08-27 17:58:30 +0200 (Wed, 27 Aug 2008)
Log Message :
Allocate ic and vap dynamically
Affected Files:
* madwifi/trunk/regression/ccmp/test_ccmp.c updated
* madwifi/trunk/regression/tkip/test_tkip.c updated
* madwifi/trunk/regression/wep/test_wep.c updated
Modified: madwifi/trunk/regression/ccmp/test_ccmp.c
===================================================================
--- madwifi/trunk/regression/ccmp/test_ccmp.c 2008-08-27 15:55:20 UTC (rev 3845)
+++ madwifi/trunk/regression/ccmp/test_ccmp.c 2008-08-27 15:58:30 UTC (rev 3846)
@@ -713,28 +713,40 @@
static int __init
init_crypto_ccmp_test(void)
{
- struct ieee80211com ic;
- struct ieee80211vap vap;
+ struct ieee80211com *ic;
+ struct ieee80211vap *vap;
int i, pass, total;
- memset(&ic, 0, sizeof(ic));
- memset(&vap, 0, sizeof(vap));
- vap.iv_ic = ⁣
+ ic = kzalloc(sizeof(*ic), GFP_KERNEL);
+ if (!ic)
+ return -ENOMEM;
+
+ ieee80211_crypto_attach(ic);
+
+ vap = kzalloc(sizeof(*vap), GFP_KERNEL);
+ if (!vap) {
+ kfree(ic);
+ return -ENOMEM;
+ }
+
+ vap->iv_ic = ic;
if (debug)
- vap.iv_debug = IEEE80211_MSG_CRYPTO;
- ieee80211_crypto_attach(&ic);
- ieee80211_crypto_vattach(&vap);
+ vap->iv_debug = IEEE80211_MSG_CRYPTO;
+ ieee80211_crypto_vattach(vap);
+
pass = 0;
total = 0;
for (i = 0; i < ARRAY_SIZE(ccmptests); i++)
if (tests & (1 << i)) {
total++;
- pass += runtest(&vap, &ccmptests[i]);
+ pass += runtest(vap, &ccmptests[i]);
}
printk("%u of %u 802.11i AES-CCMP test vectors passed\n", pass, total);
- ieee80211_crypto_vdetach(&vap);
- ieee80211_crypto_detach(&ic);
+ ieee80211_crypto_vdetach(vap);
+ ieee80211_crypto_detach(ic);
+ kfree(vap);
+ kfree(ic);
return (pass == total ? 0 : -ENXIO);
}
module_init(init_crypto_ccmp_test);
Modified: madwifi/trunk/regression/tkip/test_tkip.c
===================================================================
--- madwifi/trunk/regression/tkip/test_tkip.c 2008-08-27 15:55:20 UTC (rev 3845)
+++ madwifi/trunk/regression/tkip/test_tkip.c 2008-08-27 15:58:30 UTC (rev 3846)
@@ -372,28 +372,40 @@
static int __init
init_crypto_tkip_test(void)
{
- struct ieee80211com ic;
- struct ieee80211vap vap;
+ struct ieee80211com *ic;
+ struct ieee80211vap *vap;
int i, pass, total;
- memset(&ic, 0, sizeof(ic));
- memset(&vap, 0, sizeof(vap));
- vap.iv_ic = ⁣
+ ic = kzalloc(sizeof(*ic), GFP_KERNEL);
+ if (!ic)
+ return -ENOMEM;
+
+ ieee80211_crypto_attach(ic);
+
+ vap = kzalloc(sizeof(*vap), GFP_KERNEL);
+ if (!vap) {
+ kfree(ic);
+ return -ENOMEM;
+ }
+
+ vap->iv_ic = ic;
if (debug)
- vap.iv_debug = IEEE80211_MSG_CRYPTO;
- ieee80211_crypto_attach(&ic);
- ieee80211_crypto_vattach(&vap);
+ vap->iv_debug = IEEE80211_MSG_CRYPTO;
+ ieee80211_crypto_vattach(vap);
+
pass = 0;
total = 0;
for (i = 0; i < ARRAY_SIZE(tkiptests); i++)
if (tests & (1 << i)) {
total++;
- pass += runtest(&vap, &tkiptests[i]);
+ pass += runtest(vap, &tkiptests[i]);
}
printk("%u of %u 802.11i TKIP test vectors passed\n", pass, total);
- ieee80211_crypto_vdetach(&vap);
- ieee80211_crypto_detach(&ic);
+ ieee80211_crypto_vdetach(vap);
+ ieee80211_crypto_detach(ic);
+ kfree(vap);
+ kfree(ic);
return (pass == total ? 0 : -ENXIO);
}
module_init(init_crypto_tkip_test);
Modified: madwifi/trunk/regression/wep/test_wep.c
===================================================================
--- madwifi/trunk/regression/wep/test_wep.c 2008-08-27 15:55:20 UTC (rev 3845)
+++ madwifi/trunk/regression/wep/test_wep.c 2008-08-27 15:58:30 UTC (rev 3846)
@@ -317,27 +317,40 @@
static int __init
init_crypto_wep_test(void)
{
- struct ieee80211com ic;
- struct ieee80211vap vap;
+ struct ieee80211com *ic;
+ struct ieee80211vap *vap;
int i, pass, total;
- memset(&ic, 0, sizeof(ic));
- memset(&vap, 0, sizeof(vap));
- vap.iv_ic = ⁣
+ ic = kzalloc(sizeof(*ic), GFP_KERNEL);
+ if (!ic)
+ return -ENOMEM;
+
+ ieee80211_crypto_attach(ic);
+
+ vap = kzalloc(sizeof(*vap), GFP_KERNEL);
+ if (!vap) {
+ kfree(ic);
+ return -ENOMEM;
+ }
+
+ vap->iv_ic = ic;
if (debug)
- vap.iv_debug = IEEE80211_MSG_CRYPTO;
- ieee80211_crypto_attach(&ic);
- ieee80211_crypto_vattach(&vap);
+ vap->iv_debug = IEEE80211_MSG_CRYPTO;
+
+ ieee80211_crypto_vattach(vap);
+
pass = 0;
total = 0;
for (i = 0; i < ARRAY_SIZE(weptests); i++)
if (tests & (1 << i)) {
total++;
- pass += runtest(&vap, &weptests[i]);
+ pass += runtest(vap, &weptests[i]);
}
printk("%u of %u 802.11i WEP test vectors passed\n", pass, total);
- ieee80211_crypto_vdetach(&vap);
- ieee80211_crypto_detach(&ic);
+ ieee80211_crypto_vdetach(vap);
+ ieee80211_crypto_detach(ic);
+ kfree(vap);
+ kfree(ic);
return (pass == total ? 0 : -ENXIO);
}
module_init(init_crypto_wep_test);
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
|
|
|