diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-05-04 21:00:14 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-05-04 21:00:14 +0000 |
commit | ea6674d9de9ca1aa6771e7a8545438c2d8f2410e (patch) | |
tree | 2337dce529e6149824559965e2bf5cdf9c0e6036 /target/linux/generic-2.4/patches | |
parent | 40b344028b6b043b73512f036be7b3e963f85c88 (diff) |
[generic-2.4] add OCF 20100325 support to brcm-2.4
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21357 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic-2.4/patches')
3 files changed, 143 insertions, 2 deletions
diff --git a/target/linux/generic-2.4/patches/629-netlink_types_h.patch b/target/linux/generic-2.4/patches/629-netlink_types_h.patch index 9c5b45df6..49803b76f 100644 --- a/target/linux/generic-2.4/patches/629-netlink_types_h.patch +++ b/target/linux/generic-2.4/patches/629-netlink_types_h.patch @@ -9,8 +9,8 @@ #define NETLINK_ROUTE 0 /* Routing/device hook */ #define NETLINK_SKIP 1 /* Reserved for ENskip */ #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ ---- a/include/linux/filter.h 2010-02-01 22:04:46.000000000 +0100 -+++ b/include/linux/filter.h 2010-03-29 20:57:08.000000000 +0200 +--- a/include/linux/filter.h ++++ b/include/linux/filter.h @@ -5,6 +5,8 @@ #ifndef __LINUX_FILTER_H__ #define __LINUX_FILTER_H__ diff --git a/target/linux/generic-2.4/patches/900-ocf-kconfig-integration.patch b/target/linux/generic-2.4/patches/900-ocf-kconfig-integration.patch new file mode 100644 index 000000000..e176bf536 --- /dev/null +++ b/target/linux/generic-2.4/patches/900-ocf-kconfig-integration.patch @@ -0,0 +1,21 @@ +--- a/crypto/Config.in ++++ b/crypto/Config.in +@@ -117,4 +117,6 @@ if [ "$CONFIG_CRYPTO" = "y" ]; then + tristate ' Testing module' CONFIG_CRYPTO_TEST + fi + ++source crypto/ocf/Config.in ++ + endmenu +--- a/crypto/Makefile ++++ b/crypto/Makefile +@@ -36,4 +36,9 @@ obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += mich + + obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o + ++mod-subdirs += ocf ++subdir-$(CONFIG_OCF_OCF) += ocf ++ocf-$(CONFIG_OCF_OCF) = ocf/ocfdrv.o ++obj-$(CONFIG_OCF_OCF) += $(ocf-y) ++ + include $(TOPDIR)/Rules.make diff --git a/target/linux/generic-2.4/patches/901-ocf-20100325.patch b/target/linux/generic-2.4/patches/901-ocf-20100325.patch new file mode 100644 index 000000000..6d0f522f7 --- /dev/null +++ b/target/linux/generic-2.4/patches/901-ocf-20100325.patch @@ -0,0 +1,120 @@ +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -901,6 +901,65 @@ void add_blkdev_randomness(int major) + #define subRound(a, b, c, d, e, f, k, data) \ + ( e += ROTL( 5, a ) + f( b, c, d ) + k + data, b = ROTL( 30, b ) ) + ++/* ++ * random_input_words - add bulk entropy to pool ++ * ++ * @buf: buffer to add ++ * @wordcount: number of __u32 words to add ++ * @ent_count: total amount of entropy (in bits) to credit ++ * ++ * this provides bulk input of entropy to the input pool ++ * ++ */ ++void random_input_words(__u32 *buf, size_t wordcount, int ent_count) ++{ ++ if (!random_state) ++ return; ++ add_entropy_words(random_state, buf, wordcount); ++ ++ credit_entropy_store(random_state, ent_count); ++ ++ DEBUG_ENT("credited %d bits => %d\n", ++ ent_count, random_state->entropy_count); ++ /* ++ * Wake up waiting processes if we have enough ++ * entropy. ++ */ ++ if (random_state->entropy_count >= random_read_wakeup_thresh) ++ wake_up_interruptible(&random_read_wait); ++} ++EXPORT_SYMBOL(random_input_words); ++ ++/* ++ * random_input_wait - wait until random needs entropy ++ * ++ * this function sleeps until the /dev/random subsystem actually ++ * needs more entropy, and then return the amount of entropy ++ * that it would be nice to have added to the system. ++ */ ++int random_input_wait(void) ++{ ++ int count; ++ ++ if (!random_state) ++ return -1; ++ ++ wait_event_interruptible(random_write_wait, ++ random_state->entropy_count < random_write_wakeup_thresh); ++ ++ count = random_write_wakeup_thresh - random_state->entropy_count; ++ ++ /* likely we got woken up due to a signal */ ++ if (count <= 0) count = random_read_wakeup_thresh; ++ ++ DEBUG_ENT("requesting %d bits from input_wait()er %d<%d\n", ++ count, ++ random_state->entropy_count, random_write_wakeup_thresh); ++ ++ return count; ++} ++EXPORT_SYMBOL(random_input_wait); ++ + + static void SHATransform(__u32 digest[85], __u32 const data[16]) + { +--- a/fs/Makefile ++++ b/fs/Makefile +@@ -10,6 +10,8 @@ O_TARGET := fs.o + export-objs := filesystems.o open.o dcache.o buffer.o dquot.o + mod-subdirs := nls + ++export-objs += fcntl.o ++ + obj-y := open.o read_write.o devices.o file_table.o buffer.o \ + super.o block_dev.o char_dev.o stat.o exec.o pipe.o namei.o \ + fcntl.o ioctl.o readdir.o select.o fifo.o locks.o \ +--- a/fs/fcntl.c ++++ b/fs/fcntl.c +@@ -12,6 +12,7 @@ + #include <linux/slab.h> + #include <linux/iobuf.h> + #include <linux/ptrace.h> ++#include <linux/module.h> + + #include <asm/poll.h> + #include <asm/siginfo.h> +@@ -199,6 +200,7 @@ asmlinkage long sys_dup(unsigned int fil + ret = dupfd(file, 0); + return ret; + } ++EXPORT_SYMBOL(sys_dup); + + #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | FASYNC | O_DIRECT) + +--- a/include/linux/miscdevice.h ++++ b/include/linux/miscdevice.h +@@ -15,6 +15,7 @@ + #define ADB_MOUSE_MINOR 10 + #define MK712_MINOR 15 /* MK712 touch screen */ + #define SYNTH_MINOR 25 ++#define CRYPTODEV_MINOR 70 /* OpenBSD cryptographic framework */ + #define WATCHDOG_MINOR 130 /* Watchdog timer */ + #define TEMP_MINOR 131 /* Temperature Sensor */ + #define RTC_MINOR 135 +--- a/include/linux/random.h ++++ b/include/linux/random.h +@@ -53,6 +53,10 @@ extern void add_mouse_randomness(__u32 m + extern void add_interrupt_randomness(int irq); + extern void add_blkdev_randomness(int major); + ++extern void random_input_words(__u32 *buf, size_t wordcount, int ent_count); ++extern int random_input_wait(void); ++#define HAS_RANDOM_INPUT_WAIT 1 ++ + extern void get_random_bytes(void *buf, int nbytes); + void generate_random_uuid(unsigned char uuid_out[16]); + |