* Adjust for repository structure adjustments made in r2721
[madwifi/.git] / regression / ccmp / test_ccmp.c
index ac174b37b4898a81cec55f5280395d76add64c8b..909bb2859e576e0e0bb9effe8d41663920ec76b4 100644 (file)
@@ -589,6 +589,11 @@ runtest(struct ieee80211vap *vap, struct ciphertest *t)
 
        printk("%s: ", t->name);
 
+       if (!ieee80211_crypto_available(vap, t->cipher)) {
+               printk("FAIL: ieee80211_crypto_available failed\n");
+               return 0;
+       }
+
        /*
         * Setup key.
         */
@@ -708,7 +713,6 @@ MODULE_PARM_DESC(debug, "Enable IEEE80211_MSG_CRYPTO");
 static int __init
 init_crypto_ccmp_test(void)
 {
-#define        N(a)    (sizeof(a)/sizeof(a[0]))
        struct ieee80211com ic;
        struct ieee80211vap vap;
        int i, pass, total;
@@ -723,7 +727,7 @@ init_crypto_ccmp_test(void)
 
        pass = 0;
        total = 0;
-       for (i = 0; i < N(ccmptests); i++)
+       for (i = 0; i < ARRAY_SIZE(ccmptests); i++)
                if (tests & (1 << i)) {
                        total++;
                        pass += runtest(&vap, &ccmptests[i]);
@@ -732,7 +736,6 @@ init_crypto_ccmp_test(void)
        ieee80211_crypto_vdetach(&vap);
        ieee80211_crypto_detach(&ic);
        return (pass == total ? 0 : -ENXIO);
-#undef N
 }
 module_init(init_crypto_ccmp_test);