* Initialization code, both for static and dynamic loading. * Note this is not invoked with the usual MODULE_DECLARE * mechanism but instead is listed as a dependency by the * cryptosoft driver. This guarantees proper ordering of * calls on module load/unload. */
| 2262 | * calls on module load/unload. |
| 2263 | */ |
| 2264 | int |
| 2265 | crypto_modevent(module_t mod, int type, void *unused) |
| 2266 | { |
| 2267 | int error = EINVAL; |
| 2268 | |
| 2269 | switch (type) { |
| 2270 | case MOD_LOAD: |
| 2271 | error = crypto_init(); |
| 2272 | if (error == 0 && bootverbose) |
| 2273 | printf("crypto: <crypto core>\n"); |
| 2274 | break; |
| 2275 | case MOD_UNLOAD: |
| 2276 | /*XXX disallow if active sessions */ |
| 2277 | error = 0; |
| 2278 | crypto_destroy(); |
| 2279 | return 0; |
| 2280 | } |
| 2281 | return error; |
| 2282 | } |
| 2283 | MODULE_VERSION(crypto, 1); |
| 2284 | MODULE_DEPEND(crypto, zlib, 1, 1, 1); |
nothing calls this directly
no test coverage detected