aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/if_ether.h
Commit message (Expand)AuthorAge
* if_ether: add define for 1588 aka TimesyncAlexander Duyck2009-07-02
* Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds...David S. Miller2009-06-15
|\
| * [SCSI] net, libfcoe: Add the FCoE Initialization Protocol ethertypeJoe Eykholt2009-06-08
* | Add constants for the ieee 802.15.4 stackSergey Lapin2009-06-09
|/
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds2009-03-28
|\
| * [SCSI] net, fcoe: add ETH_P_FCOE for Fibre Channel over Ethernet (FCoE)Yi Zou2009-03-13
* | net: fix some trailing whitespacesGraf Yang2009-02-06
|/
* net: Rationalise email address: Network Specific PartsAlan Cox2008-10-13
* gre: Add Transparent Ethernet BridgingHerbert Xu2008-10-09
* dsa: add support for Trailer tagging formatLennert Buytenhek2008-10-08
* dsa: add support for original DSA tagging formatLennert Buytenhek2008-10-08
* net: Distributed Switch Architecture protocol supportLennert Buytenhek2008-10-08
* Phonet: global definitionsRemi Denis-Courmont2008-09-22
* move ETH_P_PAE from ieee80211_i.h to if_ether.hJasper Bryant-Greene2008-08-22
* [NET]: Restore sanity wrt. print_mac().David S. Miller2008-02-23
* [NET]: Elminate spurious print_mac() calls.David S. Miller2008-02-18
* [NET]: Remove MAC_FMTJoe Perches2008-02-18
* [ETHER]: Bring back MAC_FMTPatrick McHardy2008-01-28
* [ETH]: Combine format_addr() with print_mac().Michael Chan2008-01-28
* [CAN]: Allocate protocol numbers for PF_CANOliver Hartkopp2008-01-28
* [NET]: Move hardware header operations out of netdevice.Stephen Hemminger2007-10-10
* [NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()Joe Perches2007-10-10
* Add constant for FCS/CRC length (frame check sequence)Auke Kok2007-05-21
* [BRIDGE]: drop PAUSE framesStephen Hemminger2007-04-26
* [SK_BUFF]: Introduce skb_mac_header()Arnaldo Carvalho de Melo2007-04-26
* [PATCH] bonding: suppress duplicate packetsJay Vosburgh2006-03-03
* [TIPC] Move ethernet protocol id to linux/if_ether.hPer Liden2006-01-17
* [NET]: Annotate h_proto in struct ethhdrPavel Roskin2005-11-10
* [NET]: Fix GCC4 compile error: sysctl in linux/if_ether.hBen Dooks2005-09-27
* [NET]: Fix sparse warningsArnaldo Carvalho de Melo2005-08-29
* Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds2005-04-16
(tmpl); out: complete_all(&param->larval->completion); crypto_alg_put(&param->larval->alg); kfree(param); module_put_and_exit(0); } static int cryptomgr_schedule_probe(struct crypto_larval *larval) { struct task_struct *thread; struct cryptomgr_param *param; const char *name = larval->alg.cra_name; const char *p; unsigned int len; int i; if (!try_module_get(THIS_MODULE)) goto err; param = kzalloc(sizeof(*param), GFP_KERNEL); if (!param) goto err_put_module; for (p = name; isalnum(*p) || *p == '-' || *p == '_'; p++) ; len = p - name; if (!len || *p != '(') goto err_free_param; memcpy(param->template, name, len); i = 0; for (;;) { int notnum = 0; name = ++p; for (; isalnum(*p) || *p == '-' || *p == '_'; p++) notnum |= !isdigit(*p); if (*p == '(') { int recursion = 0; for (;;) { if (!*++p) goto err_free_param; if (*p == '(') recursion++; else if (*p == ')' && !recursion--) break; } notnum = 1; p++; } len = p - name; if (!len) goto err_free_param; if (notnum) { param->attrs[i].alg.attr.rta_len = sizeof(param->attrs[i].alg); param->attrs[i].alg.attr.rta_type = CRYPTOA_ALG; memcpy(param->attrs[i].alg.data.name, name, len); } else { param->attrs[i].nu32.attr.rta_len = sizeof(param->attrs[i].nu32); param->attrs[i].nu32.attr.rta_type = CRYPTOA_U32; param->attrs[i].nu32.data.num = simple_strtol(name, NULL, 0); } param->tb[i + 1] = &param->attrs[i].attr; i++; if (i >= CRYPTO_MAX_ATTRS) goto err_free_param; if (*p == ')') break; if (*p != ',') goto err_free_param; } if (!i) goto err_free_param; param->tb[i + 1] = NULL; param->type.attr.rta_len = sizeof(param->type); param->type.attr.rta_type = CRYPTOA_TYPE; param->type.data.type = larval->alg.cra_flags & ~CRYPTO_ALG_TESTED; param->type.data.mask = larval->mask & ~CRYPTO_ALG_TESTED; param->tb[0] = &param->type.attr; param->otype = larval->alg.cra_flags; param->omask = larval->mask; crypto_alg_get(&larval->alg); param->larval = larval; thread = kthread_run(cryptomgr_probe, param, "cryptomgr_probe"); if (IS_ERR(thread)) goto err_put_larval; wait_for_completion_interruptible(&larval->completion); return NOTIFY_STOP; err_put_larval: crypto_alg_put(&larval->alg); err_free_param: kfree(param); err_put_module: module_put(THIS_MODULE); err: return NOTIFY_OK; } static int cryptomgr_test(void *data) { struct crypto_test_param *param = data; u32 type = param->type; int err = 0; #ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS goto skiptest; #endif if (type & CRYPTO_ALG_TESTED) goto skiptest; err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED); skiptest: crypto_alg_tested(param->driver, err); kfree(param); module_put_and_exit(0); } static int cryptomgr_schedule_test(struct crypto_alg *alg) { struct task_struct *thread; struct crypto_test_param *param; u32 type; if (!try_module_get(THIS_MODULE)) goto err; param = kzalloc(sizeof(*param), GFP_KERNEL); if (!param) goto err_put_module; memcpy(param->driver, alg->cra_driver_name, sizeof(param->driver)); memcpy(param->alg, alg->cra_name, sizeof(param->alg)); type = alg->cra_flags; /* Do not test internal algorithms. */ if (type & CRYPTO_ALG_INTERNAL) type |= CRYPTO_ALG_TESTED; param->type = type; thread = kthread_run(cryptomgr_test, param, "cryptomgr_test"); if (IS_ERR(thread)) goto err_free_param; return NOTIFY_STOP; err_free_param: kfree(param); err_put_module: module_put(THIS_MODULE); err: return NOTIFY_OK; } static int cryptomgr_notify(struct notifier_block *this, unsigned long msg, void *data) { switch (msg) { case CRYPTO_MSG_ALG_REQUEST: return cryptomgr_schedule_probe(data); case CRYPTO_MSG_ALG_REGISTER: return cryptomgr_schedule_test(data); case CRYPTO_MSG_ALG_LOADED: break; } return NOTIFY_DONE; } static struct notifier_block cryptomgr_notifier = { .notifier_call = cryptomgr_notify, }; static int __init cryptomgr_init(void) { return crypto_register_notifier(&cryptomgr_notifier); } static void __exit cryptomgr_exit(void) { int err = crypto_unregister_notifier(&cryptomgr_notifier); BUG_ON(err); } subsys_initcall(cryptomgr_init); module_exit(cryptomgr_exit); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Crypto Algorithm Manager");