aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/Perf-Trace-Util
diff options
context:
space:
mode:
authorJamie Lentin <jm@lentin.co.uk>2014-07-23 18:30:48 -0400
committerJiri Kosina <jkosina@suse.cz>2014-07-29 05:24:47 -0400
commitf3d4ff0e04cc4450bdc7a4140020913b1280d205 (patch)
treef4298002a0fd85a9ec39f595e1d1e8bea6e87894 /tools/perf/scripts/python/Perf-Trace-Util
parente0a6aad6014be2d4fbb24dfb8e046308da1df8c8 (diff)
HID: lenovo: Add support for Compact (BT|USB) keyboard
Add support for both ThinkPad Compact Bluetooth Keyboard with TrackPoint and ThinkPad Compact USB Keyboard with TrackPoint. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Reviewed-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util')
0 files changed, 0 insertions, 0 deletions
2, 25, 4294967288UL, 4); state->s3 = TAUSWORTHE(state->s3, 3, 11, 4294967280UL, 17); return (state->s1 ^ state->s2 ^ state->s3); } EXPORT_SYMBOL(prandom32); /** * random32 - pseudo random number generator * * A 32 bit pseudo-random number is generated using a fast * algorithm suitable for simulation. This algorithm is NOT * considered safe for cryptographic use. */ u32 random32(void) { unsigned long r; struct rnd_state *state = &get_cpu_var(net_rand_state); r = prandom32(state); put_cpu_var(state); return r; } EXPORT_SYMBOL(random32); /** * srandom32 - add entropy to pseudo random number generator * @seed: seed value * * Add some additional seeding to the random32() pool. */ void srandom32(u32 entropy) { int i; /* * No locking on the CPUs, but then somewhat random results are, well, * expected. */ for_each_possible_cpu (i) { struct rnd_state *state = &per_cpu(net_rand_state, i); state->s1 = __seed(state->s1 ^ entropy, 1); } } EXPORT_SYMBOL(srandom32); /* * Generate some initially weak seeding values to allow * to start the random32() engine. */ static int __init random32_init(void) { int i; for_each_possible_cpu(i) { struct rnd_state *state = &per_cpu(net_rand_state,i); #define LCG(x) ((x) * 69069) /* super-duper LCG */ state->s1 = __seed(LCG(i + jiffies), 1); state->s2 = __seed(LCG(state->s1), 7); state->s3 = __seed(LCG(state->s2), 15); /* "warm it up" */ prandom32(state); prandom32(state); prandom32(state); prandom32(state); prandom32(state); prandom32(state); } return 0; } core_initcall(random32_init); /* * Generate better values after random number generator * is fully initialized. */ static int __init random32_reseed(void) { int i; for_each_possible_cpu(i) { struct rnd_state *state = &per_cpu(net_rand_state,i); u32 seeds[3]; get_random_bytes(&seeds, sizeof(seeds)); state->s1 = __seed(seeds[0], 1); state->s2 = __seed(seeds[1], 7); state->s3 = __seed(seeds[2], 15); /* mix it in */ prandom32(state); } return 0; } late_initcall(random32_reseed);