[email protected]
[Top] [All Lists]

PERFORCE change 114936 for review

Subject: PERFORCE change 114936 for review
From: Sam Leffler
Date: Sat, 24 Feb 2007 00:06:13 GMT
http://perforce.freebsd.org/chv.cgi?CH=114936

Change 114936 by [email protected]_ebb on 2007/02/24 00:06:02

        add portability shim for crypto modules to improve portability

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211_crypto_ccmp.c#11 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_crypto_tkip.c#14 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_crypto_wep.c#11 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_freebsd.h#22 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211_crypto_ccmp.c#11 (text+ko) 
====

@@ -635,32 +635,4 @@
 /*
  * Module glue.
  */
-static int
-ccmp_modevent(module_t mod, int type, void *unused)
-{
-       switch (type) {
-       case MOD_LOAD:
-               ieee80211_crypto_register(&ccmp);
-               return 0;
-       case MOD_UNLOAD:
-       case MOD_QUIESCE:
-               if (nrefs) {
-                       printf("wlan_ccmp: still in use (%u dynamic refs)\n",
-                               nrefs);
-                       return EBUSY;
-               }
-               if (type == MOD_UNLOAD)
-                       ieee80211_crypto_unregister(&ccmp);
-               return 0;
-       }
-       return EINVAL;
-}
-
-static moduledata_t ccmp_mod = {
-       "wlan_ccmp",
-       ccmp_modevent,
-       0
-};
-DECLARE_MODULE(wlan_ccmp, ccmp_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
-MODULE_VERSION(wlan_ccmp, 1);
-MODULE_DEPEND(wlan_ccmp, wlan, 1, 1, 1);
+IEEE80211_CRYPTO_MODULE(ccmp, 1);

==== //depot/projects/wifi/sys/net80211/ieee80211_crypto_tkip.c#14 (text+ko) 
====

@@ -976,32 +976,4 @@
 /*
  * Module glue.
  */
-static int
-tkip_modevent(module_t mod, int type, void *unused)
-{
-       switch (type) {
-       case MOD_LOAD:
-               ieee80211_crypto_register(&tkip);
-               return 0;
-       case MOD_UNLOAD:
-       case MOD_QUIESCE:
-               if (nrefs) {
-                       printf("wlan_tkip: still in use (%u dynamic refs)\n",
-                               nrefs);
-                       return EBUSY;
-               }
-               if (type == MOD_UNLOAD)
-                       ieee80211_crypto_unregister(&tkip);
-               return 0;
-       }
-       return EINVAL;
-}
-
-static moduledata_t tkip_mod = {
-       "wlan_tkip",
-       tkip_modevent,
-       0
-};
-DECLARE_MODULE(wlan_tkip, tkip_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
-MODULE_VERSION(wlan_tkip, 1);
-MODULE_DEPEND(wlan_tkip, wlan, 1, 1, 1);
+IEEE80211_CRYPTO_MODULE(tkip, 1);

==== //depot/projects/wifi/sys/net80211/ieee80211_crypto_wep.c#11 (text+ko) ====

@@ -479,32 +479,4 @@
 /*
  * Module glue.
  */
-static int
-wep_modevent(module_t mod, int type, void *unused)
-{
-       switch (type) {
-       case MOD_LOAD:
-               ieee80211_crypto_register(&wep);
-               return 0;
-       case MOD_UNLOAD:
-       case MOD_QUIESCE:
-               if (nrefs) {
-                       printf("wlan_wep: still in use (%u dynamic refs)\n",
-                               nrefs);
-                       return EBUSY;
-               }
-               if (type == MOD_UNLOAD)
-                       ieee80211_crypto_unregister(&wep);
-               return 0;
-       }
-       return EINVAL;
-}
-
-static moduledata_t wep_mod = {
-       "wlan_wep",
-       wep_modevent,
-       0
-};
-DECLARE_MODULE(wlan_wep, wep_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
-MODULE_VERSION(wlan_wep, 1);
-MODULE_DEPEND(wlan_wep, wlan, 1, 1, 1);
+IEEE80211_CRYPTO_MODULE(wep, 1);

==== //depot/projects/wifi/sys/net80211/ieee80211_freebsd.h#22 (text+ko) ====

@@ -219,6 +219,36 @@
 void   ieee80211_sysctl_detach(struct ieee80211com *);
 
 void   ieee80211_load_module(const char *);
+
+#define        IEEE80211_CRYPTO_MODULE(name, version) \
+static int                                                             \
+name##_modevent(module_t mod, int type, void *unused)                  \
+{                                                                      \
+       switch (type) {                                                 \
+       case MOD_LOAD:                                                  \
+               ieee80211_crypto_register(&name);                       \
+               return 0;                                               \
+       case MOD_UNLOAD:                                                \
+       case MOD_QUIESCE:                                               \
+               if (nrefs) {                                            \
+                       printf("wlan_##name: still in use (%u dynamic refs)\n",\
+                               nrefs);                                 \
+                       return EBUSY;                                   \
+               }                                                       \
+               if (type == MOD_UNLOAD)                                 \
+                       ieee80211_crypto_unregister(&name);             \
+               return 0;                                               \
+       }                                                               \
+       return EINVAL;                                                  \
+}                                                                      \
+static moduledata_t name##_mod = {                                     \
+       "wlan_##name",                                                  \
+       name##_modevent,                                                \
+       0                                                               \
+};                                                                     \
+DECLARE_MODULE(wlan_##name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);\
+MODULE_VERSION(wlan_##name, version);                                  \
+MODULE_DEPEND(wlan_##name, wlan, 1, 1, 1)
 #endif /* _KERNEL */
 
 /* XXX this stuff belongs elsewhere */
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "[email protected]"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 114936 for review, Sam Leffler <=