diff --git a/include/image.mk b/include/image.mk index 34453f460..98e32b349 100644 --- a/include/image.mk +++ b/include/image.mk @@ -18,32 +18,13 @@ KDIR=$(KERNEL_BUILD_DIR) IMG_PREFIX:=openwrt-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)) ifneq ($(CONFIG_BIG_ENDIAN),y) -JFFS2OPTS := --pad --little-endian --squash -v +JFFS2OPTS := --pad --little-endian --squash SQUASHFS_OPTS := -le else -JFFS2OPTS := --pad --big-endian --squash -v +JFFS2OPTS := --pad --big-endian --squash SQUASHFS_OPTS := -be endif -ifeq ($(CONFIG_JFFS2_RTIME),y) -JFFS2OPTS+= -X rtime -endif -ifeq ($(CONFIG_JFFS2_ZLIB),y) -JFFS2OPTS+= -X zlib -endif -ifeq ($(CONFIG_JFFS2_LZMA),y) -JFFS2OPTS+= -X lzma --compression-mode=size -endif -ifneq ($(CONFIG_JFFS2_RTIME),y) -JFFS2OPTS+= -x rtime -endif -ifneq ($(CONFIG_JFFS2_ZLIB),y) -JFFS2OPTS+= -x zlib -endif -ifneq ($(CONFIG_JFFS2_LZMA),y) -JFFS2OPTS+= -x lzma -endif - ifneq ($(CONFIG_LINUX_2_4)$(CONFIG_LINUX_2_6_25),) USE_SQUASHFS3 := y endif @@ -78,7 +59,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) ifeq ($(CONFIG_TARGET_ROOTFS_JFFS2),y) define Image/mkfs/jffs2/sub # FIXME: removing this line will cause strange behaviour in the foreach loop below - $(STAGING_DIR_HOST)/bin/mkfs.jffs2 $(JFFS2OPTS) -e $(patsubst %k,%KiB,$(1)) -o $(KDIR)/root.jffs2-$(1) -d $(TARGET_DIR) -v 2>&1 1>/dev/null | awk '/^.+$$$$/' + $(STAGING_DIR_HOST)/bin/mkfs.jffs2 $(JFFS2OPTS) -e $(patsubst %k,%KiB,$(1)) -o $(KDIR)/root.jffs2-$(1) -d $(TARGET_DIR) $(call add_jffs2_mark,$(KDIR)/root.jffs2-$(1)) $(call Image/Build,jffs2-$(1)) endef diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index 0969b844a..300139cab 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -97,8 +97,9 @@ define Kernel/Configure/2.6 endef define Kernel/Configure/Default $(LINUX_CONFCMD) > $(LINUX_DIR)/.config.target -# copy CONFIG_KERNEL_* settings over to .config.target - awk '/^(#[[:space:]]+)?CONFIG_KERNEL/{sub("CONFIG_KERNEL_","CONFIG_");print}' $(TOPDIR)/.config >> $(LINUX_DIR)/.config.target + echo "$(if $(CONFIG_KERNEL_KALLSYMS),CONFIG_KALLSYMS=y,# CONFIG_KALLSYMS is not set)" >> $(LINUX_DIR)/.config.target + echo "$(if $(CONFIG_KERNEL_PROFILING),CONFIG_PROFILING=y,# CONFIG_PROFILING is not set)" >> $(LINUX_DIR)/.config.target + echo "$(if $(CONFIG_KERNEL_DEBUG_FS),CONFIG_DEBUG_FS=y,# CONFIG_DEBUG_FS is not set)" >> $(LINUX_DIR)/.config.target echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> $(LINUX_DIR)/.config.target echo "# CONFIG_KALLSYMS_ALL is not set" >> $(LINUX_DIR)/.config.target echo "# CONFIG_KPROBES is not set" >> $(LINUX_DIR)/.config.target diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 284b96397..e4f0b486f 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -20,21 +20,12 @@ endif ifeq ($(LINUX_VERSION),2.6.32.10) LINUX_KERNEL_MD5SUM:=5d996507ad482a3a8c8e6b2d48e7994b endif -ifeq ($(LINUX_VERSION),2.6.32.11) - LINUX_KERNEL_MD5SUM:=3709c691d909b4f8ca692edc6c726cb6 -endif ifeq ($(LINUX_VERSION),2.6.33) LINUX_KERNEL_MD5SUM:=c3883760b18d50e8d78819c54d579b00 endif ifeq ($(LINUX_VERSION),2.6.33.1) LINUX_KERNEL_MD5SUM:=73b514ec918b88a45656be191b1ee226 endif -ifeq ($(LINUX_VERSION),2.6.33.2) - LINUX_KERNEL_MD5SUM:=80c5ff544b0ee4d9b5d8b8b89d4a0ef9 -endif -ifeq ($(LINUX_VERSION),2.6.34-rc4) - LINUX_KERNEL_MD5SUM:=45b185f33300bbd69034779748b52c5f -endif # disable the md5sum check for unknown kernel versions LINUX_KERNEL_MD5SUM?=x diff --git a/package/base-files/files/etc/hotplug2-common.rules b/package/base-files/files/etc/hotplug2-common.rules index 96a473116..bb76667bb 100644 --- a/package/base-files/files/etc/hotplug2-common.rules +++ b/package/base-files/files/etc/hotplug2-common.rules @@ -1,10 +1,4 @@ -# uncomment me to log hotplug events -# DEVPATH is set { -# nothrottle -# exec logger -s -t hotplug -p daemon.info "name=%DEVICENAME%, path=%DEVPATH%" -# } - DEVICENAME ~~ (null|full|ptmx|tty|zero|gpio|hvc) { nothrottle makedev /dev/%DEVICENAME% 0666 diff --git a/package/base-files/files/etc/init.d/rcS b/package/base-files/files/etc/init.d/rcS index ea40d68be..c135024be 100755 --- a/package/base-files/files/etc/init.d/rcS +++ b/package/base-files/files/etc/init.d/rcS @@ -10,12 +10,7 @@ run_scripts() { LOGGER="cat" [ -x /usr/bin/logger ] && LOGGER="logger -s -p 6 -t sysinit" -. /etc/functions.sh - -config_load system -config_get_bool foreground system foreground no - -if [ "$1" = "S" -a "$foreground" != "yes" ]; then +if [ "$1" = "S" ]; then run_scripts "$1" "$2" & else run_scripts "$1" "$2" diff --git a/package/broadcom-diag/src/diag.c b/package/broadcom-diag/src/diag.c index 38f51cb65..27a3ee438 100644 --- a/package/broadcom-diag/src/diag.c +++ b/package/broadcom-diag/src/diag.c @@ -60,7 +60,6 @@ enum { WRT54G, WRTSL54GS, WRT54G3G, - WRT54G3GV2_VF, WRT160N, WRT300NV11, WRT350N, @@ -272,18 +271,6 @@ static struct platform_t __initdata platforms[] = { { .name = "3g_blink", .gpio = 1 << 5, .polarity = NORMAL }, }, }, - [WRT54G3GV2_VF] = { - .name = "Linksys WRT54G3GV2-VF", - .buttons = { - { .name = "reset", .gpio = 1 << 6 }, - { .name = "3g", .gpio = 1 << 4 }, - }, - .leds = { - { .name = "power", .gpio = 1 << 1, .polarity = NORMAL }, - { .name = "3g_green", .gpio = 1 << 2, .polarity = NORMAL }, - { .name = "3g_blue", .gpio = 1 << 3, .polarity = NORMAL }, - }, - }, [WRT160N] = { .name = "Linksys WRT160N", .buttons = { @@ -996,9 +983,6 @@ static struct platform_t __init *platform_detect(void) if (!strcmp(boardtype, "0x0101") && !strcmp(getvar("boot_ver"), "v3.6")) return &platforms[WRT54G3G]; - if (!strcmp(boardtype, "0x042f") && !strcmp(getvar("model_name"), "WRT54G3GV2-VF")) - return &platforms[WRT54G3GV2_VF]; - if (!strcmp(getvar("et1phyaddr"),"5") && !strcmp(getvar("et1mdcport"), "1")) return &platforms[WRTSL54GS]; diff --git a/package/busybox/config/Config.in b/package/busybox/config/Config.in index f7ee7b3d4..3beb0d12a 100644 --- a/package/busybox/config/Config.in +++ b/package/busybox/config/Config.in @@ -29,23 +29,6 @@ config BUSYBOX_CONFIG_EXTRA_COMPAT some GNU extensions in libc. You probably only need this option if you plan to run busybox on desktop. -config BUSYBOX_CONFIG_INCLUDE_SUSv2 - bool "Enable obsolete features removed before SUSv3" - default y - help - This option will enable backwards compatibility with SuSv2, - specifically, old-style numeric options ('command -1 ') - will be supported in head, tail, and fold. (Note: should - affect renice too.) - -config BUSYBOX_CONFIG_USE_PORTABLE_CODE - bool "Avoid using GCC-specific code constructs" - default n - help - Use this option if you are trying to compile busybox with - compiler other than gcc. - If you do use gcc, this option may needlessly increase code size. - choice prompt "Buffer allocation policy" default BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK @@ -519,8 +502,17 @@ config BUSYBOX_CONFIG_EFENCE endchoice +config BUSYBOX_CONFIG_INCLUDE_SUSv2 + bool "Enable obsolete features removed before SUSv3?" + default y + help + This option will enable backwards compatibility with SuSv2, + specifically, old-style numeric options ('command -1 ') + will be supported in head, tail, and fold. (Note: should + affect renice too.) + ### config PARSE -### bool "Uniform config file parser debugging applet: parse" +### bool "Uniform config file parser debugging applet: parse" endmenu diff --git a/package/busybox/config/archival/Config.in b/package/busybox/config/archival/Config.in index 403a631dd..5103be484 100644 --- a/package/busybox/config/archival/Config.in +++ b/package/busybox/config/archival/Config.in @@ -165,13 +165,6 @@ config BUSYBOX_CONFIG_GZIP gzip is used to compress files. It's probably the most widely used UNIX compression program. -config BUSYBOX_CONFIG_FEATURE_GZIP_LONG_OPTIONS - bool "Enable long options" - default n - depends on BUSYBOX_CONFIG_GZIP && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options, increases size by about 106 Bytes - config BUSYBOX_CONFIG_LZOP bool "lzop" default n @@ -276,14 +269,6 @@ config BUSYBOX_CONFIG_FEATURE_TAR_UNAME_GNAME listings (-t) and preserving permissions when unpacking (-p). +200 bytes. -config BUSYBOX_CONFIG_FEATURE_TAR_NOPRESERVE_TIME - bool "Enable -m (do not preserve time) option" - default n - depends on BUSYBOX_CONFIG_TAR - help - With this option busybox supports GNU tar -m - (do not preserve time) option. - endif #tar config BUSYBOX_CONFIG_UNCOMPRESS diff --git a/package/busybox/config/coreutils/Config.in b/package/busybox/config/coreutils/Config.in index 759d98dab..06e7874e2 100644 --- a/package/busybox/config/coreutils/Config.in +++ b/package/busybox/config/coreutils/Config.in @@ -52,13 +52,6 @@ config BUSYBOX_CONFIG_CHOWN chown is used to change the user and/or group ownership of files. -config BUSYBOX_CONFIG_FEATURE_CHOWN_LONG_OPTIONS - bool "Enable long options" - default n - depends on BUSYBOX_CONFIG_CHOWN && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options - config BUSYBOX_CONFIG_CHROOT bool "chroot" default y @@ -85,14 +78,6 @@ config BUSYBOX_CONFIG_CP help cp is used to copy files and directories. -config BUSYBOX_CONFIG_FEATURE_CP_LONG_OPTIONS - bool "Enable long options for cp" - default n - depends on BUSYBOX_CONFIG_CP && BUSYBOX_CONFIG_LONG_OPTS - help - Enable long options for cp. - Also add support for --parents option. - config BUSYBOX_CONFIG_CUT bool "cut" default y @@ -115,22 +100,6 @@ config BUSYBOX_CONFIG_FEATURE_DATE_ISOFMT Enable option (-I) to output an ISO-8601 compliant date/time string. -config BUSYBOX_CONFIG_FEATURE_DATE_COMPAT - bool "Support weird 'date MMDDhhmm[[YY]YY][.ss]' format" - default n - depends on BUSYBOX_CONFIG_DATE - help - System time can be set by 'date -s DATE' and simply 'date DATE', - but formats of DATE string are different. 'date DATE' accepts - a rather weird MMDDhhmm[[YY]YY][.ss] format with completely - unnatural placement of year between minutes and seconds. - date -s (and other commands like touch -d) use more sensible - formats (for one, ISO format YYYY-MM-DD hh:mm:ss.ssssss). - - With this option off, 'date DATE' is 'date -s DATE' support - the same format. With it on, 'date DATE' additionally supports - MMDDhhmm[[YY]YY][.ss] format. - config BUSYBOX_CONFIG_DD bool "dd" default y @@ -144,22 +113,13 @@ config BUSYBOX_CONFIG_FEATURE_DD_SIGNAL_HANDLING default y depends on BUSYBOX_CONFIG_DD help - Sending a SIGUSR1 signal to a running `dd' process makes it + sending a SIGUSR1 signal to a running `dd' process makes it print to standard error the number of records read and written so far, then to resume copying. $ dd if=/dev/zero of=/dev/null& $ pid=$! kill -USR1 $pid; sleep 1; kill $pid - 10899206+0 records in - 10899206+0 records out - -config BUSYBOX_CONFIG_FEATURE_DD_THIRD_STATUS_LINE - bool "Enable the third status line upon signal" - default n - depends on BUSYBOX_CONFIG_DD && BUSYBOX_CONFIG_FEATURE_DD_SIGNAL_HANDLING - help - Displays a coreutils-like third status line with transferred bytes, - elapsed time and speed. + 10899206+0 records in 10899206+0 records out config BUSYBOX_CONFIG_FEATURE_DD_IBS_OBS bool "Enable ibs, obs and conv options" @@ -869,13 +829,13 @@ config BUSYBOX_CONFIG_FEATURE_HUMAN_READABLE help Allow df, du, and ls to have human readable output. -comment "Common options for md5sum, sha1sum, sha256sum, sha512sum" - depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM +comment "Common options for md5sum, sha1sum" + depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM config BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK bool "Enable -c, -s and -w options" default y - depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM + depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM help Enabling the -c options allows files to be checked against pre-calculated hash values. diff --git a/package/busybox/config/editors/Config.in b/package/busybox/config/editors/Config.in index 6175df72f..9eb85bbb8 100644 --- a/package/busybox/config/editors/Config.in +++ b/package/busybox/config/editors/Config.in @@ -35,12 +35,13 @@ config BUSYBOX_CONFIG_DIFF differences between them in a form that can be given to the patch command. -config BUSYBOX_CONFIG_FEATURE_DIFF_LONG_OPTIONS - bool "Enable long options" +config BUSYBOX_CONFIG_FEATURE_DIFF_BINARY + bool "Enable checks for binary files" default n - depends on BUSYBOX_CONFIG_DIFF && BUSYBOX_CONFIG_LONG_OPTS + depends on BUSYBOX_CONFIG_DIFF help - Enable use of long options. + This option enables support for checking for binary files + before a comparison is carried out. config BUSYBOX_CONFIG_FEATURE_DIFF_DIR bool "Enable directory support" @@ -50,6 +51,14 @@ config BUSYBOX_CONFIG_FEATURE_DIFF_DIR This option enables support for directory and subdirectory comparison. +config BUSYBOX_CONFIG_FEATURE_DIFF_MINIMAL + bool "Enable -d option to find smaller sets of changes" + default n + depends on BUSYBOX_CONFIG_DIFF + help + Enabling this option allows the use of -d to make diff + try hard to find the smallest possible set of changes. + config BUSYBOX_CONFIG_ED bool "ed" default n diff --git a/package/busybox/config/findutils/Config.in b/package/busybox/config/findutils/Config.in index 80de398cd..32a213b46 100644 --- a/package/busybox/config/findutils/Config.in +++ b/package/busybox/config/findutils/Config.in @@ -171,13 +171,6 @@ config BUSYBOX_CONFIG_FEATURE_FIND_CONTEXT help Support the 'find -context' option for matching security context. -config BUSYBOX_CONFIG_FEATURE_FIND_LINKS - bool "Enable -links: link count matching" - default n - depends on BUSYBOX_CONFIG_FIND - help - Support the 'find -links' option for matching number of links. - config BUSYBOX_CONFIG_GREP bool "grep" default y diff --git a/package/busybox/config/libbb/Config.in b/package/busybox/config/libbb/Config.in index ec1071565..8016ef080 100644 --- a/package/busybox/config/libbb/Config.in +++ b/package/busybox/config/libbb/Config.in @@ -111,7 +111,7 @@ config BUSYBOX_CONFIG_FEATURE_EDITING_ASK_TERMINAL current cursor position. This information is used to make line editing more robust in some cases. If you are not sure whether your terminals respond to this code - correctly, or want to save on code size (about 400 bytes), + correctly, or want to save on code size (about 300 bytes), then do not turn this option on. config BUSYBOX_CONFIG_FEATURE_NON_POSIX_CP @@ -134,8 +134,9 @@ config BUSYBOX_CONFIG_FEATURE_VERBOSE_CP_MESSAGE $ cp file /vmlinuz/file cp: cannot stat '/vmlinuz/file': Path has non-directory component If this feature is not enabled, they will be, respectively: - cp: cannot create '/does_not_exist/file': No such file or directory + cp: cannot remove '/does_not_exist/file': No such file or directory cp: cannot stat '/vmlinuz/file': Not a directory + respectively. This will cost you ~60 bytes. config BUSYBOX_CONFIG_FEATURE_COPYBUF_KB diff --git a/package/busybox/config/miscutils/Config.in b/package/busybox/config/miscutils/Config.in index 9d4a3700a..9dce72ebd 100644 --- a/package/busybox/config/miscutils/Config.in +++ b/package/busybox/config/miscutils/Config.in @@ -137,11 +137,11 @@ config BUSYBOX_CONFIG_FEATURE_CROND_D -d sets loglevel to 0 (most verbose) and directs all output to stderr. config BUSYBOX_CONFIG_FEATURE_CROND_CALL_SENDMAIL - bool "Report command output via email (using sendmail)" + bool "Using /usr/sbin/sendmail?" default n depends on BUSYBOX_CONFIG_CROND help - Command output will be sent to corresponding user via email. + Support calling /usr/sbin/sendmail for send cmd outputs. config BUSYBOX_CONFIG_FEATURE_CROND_DIR string "crond spool directory" @@ -272,13 +272,6 @@ config BUSYBOX_CONFIG_FBSPLASH "NN" (ASCII decimal number) - percentage to show on progress bar "exit" - well you guessed it -config BUSYBOX_CONFIG_FLASHCP - bool "flashcp" - default n - help - The flashcp binary, inspired by mtd-utils as of git head 5eceb74f7. - This utility is used to copy images into a MTD device. - config BUSYBOX_CONFIG_FLASH_LOCK bool "flash_lock" default n @@ -625,12 +618,6 @@ config BUSYBOX_CONFIG_VOLNAME help Prints a CD-ROM volume name. -config BUSYBOX_CONFIG_WALL - bool "wall" - default n - help - Write a message to all users that are logged in. - config BUSYBOX_CONFIG_WATCHDOG bool "watchdog" default y diff --git a/package/busybox/config/modutils/Config.in b/package/busybox/config/modutils/Config.in index db515b547..9ec54b1e9 100644 --- a/package/busybox/config/modutils/Config.in +++ b/package/busybox/config/modutils/Config.in @@ -121,22 +121,6 @@ config BUSYBOX_CONFIG_FEATURE_2_4_MODULES This increases size considerably. Say N unless you plan to run ancient kernels. -config BUSYBOX_CONFIG_FEATURE_INSMOD_TRY_MMAP - bool "Try to load module from a mmap'ed area" - default n - depends on BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE_SMALL - help - This option causes module loading code to try to mmap - module first. If it does not work (for example, - it does not work for compressed modules), module will be read - (and unpacked if needed) into a memory block allocated by malloc. - - The only case when mmap works but malloc does not is when - you are trying to load a big module on a very memory-constrained - machine. Malloc will momentarily need 2x as much memory as mmap. - - Choosing N saves about 250 bytes of code (on 32-bit x86). - config BUSYBOX_CONFIG_FEATURE_INSMOD_VERSION_CHECKING bool "Enable module version checking" default n diff --git a/package/busybox/config/networking/Config.in b/package/busybox/config/networking/Config.in index 99a8eddca..77a7b07c3 100644 --- a/package/busybox/config/networking/Config.in +++ b/package/busybox/config/networking/Config.in @@ -117,17 +117,6 @@ config BUSYBOX_CONFIG_FEATURE_FTP_WRITE help Enable all kinds of FTP upload commands (-w option) -config BUSYBOX_CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST - bool "Enable workaround for RFC-violating clients" - default n - depends on BUSYBOX_CONFIG_FTPD - help - Some ftp-clients (among them KDE's Konqueror) issue illegal - "LIST -la" requests. This option works around those problems. - It might prevent you from listing files starting with "-" and - it increases the code size by ~40 bytes. - Most other ftp servers seem to behave similar to this. - config BUSYBOX_CONFIG_FTPGET bool "ftpget" default n @@ -678,20 +667,6 @@ config BUSYBOX_CONFIG_NSLOOKUP help nslookup is a tool to query Internet name servers. -config BUSYBOX_CONFIG_NTPD - bool "ntpd" - default n - help - The NTP client/server daemon. - -config BUSYBOX_CONFIG_FEATURE_NTPD_SERVER - bool "Make ntpd usable as a NTP server" - default n - depends on BUSYBOX_CONFIG_NTPD - help - Make ntpd usable as a NTP server. If you disable this option - ntpd will be usable only as a NTP client. - config BUSYBOX_CONFIG_PING bool "ping" default y @@ -819,27 +794,6 @@ config BUSYBOX_CONFIG_FEATURE_TELNETD_STANDALONE help Selecting this will make telnetd able to run standalone. -config BUSYBOX_CONFIG_FEATURE_TELNETD_INETD_WAIT - bool "Support -w SEC option (inetd wait mode)" - default n - depends on BUSYBOX_CONFIG_FEATURE_TELNETD_STANDALONE - help - This option allows you to run telnetd in "inet wait" mode. - Example inetd.conf line (note "wait", not usual "nowait"): - - telnet stream tcp wait root /bin/telnetd telnetd -w10 - - In this example, inetd passes _listening_ socket_ as fd 0 - to telnetd when connection appears. - telnetd will wait for connections until all existing - connections are closed, and no new connections - appear during 10 seconds. Then it exits, and inetd continues - to listen for new connections. - - This option is rarely used. "tcp nowait" is much more usual - way of running tcp services, including telnetd. - You most probably want to say N here. - config BUSYBOX_CONFIG_TFTP bool "tftp" default n @@ -877,19 +831,12 @@ config BUSYBOX_CONFIG_FEATURE_TFTP_PUT Also enable download support in tftpd, if tftpd is selected. config BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE - bool "Enable 'blksize' and 'tsize' protocol options" + bool "Enable \"blksize\" protocol option" default n depends on BUSYBOX_CONFIG_TFTP || BUSYBOX_CONFIG_TFTPD help Allow tftp to specify block size, and tftpd to understand - "blksize" and "tsize" options. - -config BUSYBOX_CONFIG_FEATURE_TFTP_PROGRESS_BAR - bool "Enable tftp progress meter" - default n - depends on BUSYBOX_CONFIG_TFTP && BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE - help - Show progress bar. + "blksize" option. config BUSYBOX_CONFIG_TFTP_DEBUG bool "Enable debug" @@ -905,13 +852,6 @@ config BUSYBOX_CONFIG_TRACEROUTE help Utility to trace the route of IP packets. -config BUSYBOX_CONFIG_TRACEROUTE6 - bool "traceroute6" - default n - depends on BUSYBOX_CONFIG_FEATURE_IPV6 && BUSYBOX_CONFIG_TRACEROUTE - help - Utility to trace the route of IPv6 packets. - config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_VERBOSE bool "Enable verbose output" default y @@ -940,7 +880,7 @@ source package/busybox/config/networking/udhcp/Config.in config BUSYBOX_CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS string "ifup udhcpc command line options" default "-R -n" - depends on BUSYBOX_CONFIG_IFUPDOWN && BUSYBOX_CONFIG_UDHCPC + depends on BUSYBOX_CONFIG_IFUPDOWN && BUSYBOX_CONFIG_APP_UDHCPC help Command line options to pass to udhcpc from ifup. Intended to alter options not available in /etc/network/interfaces. diff --git a/package/busybox/config/networking/udhcp/Config.in b/package/busybox/config/networking/udhcp/Config.in index 2597f72ca..22156232f 100644 --- a/package/busybox/config/networking/udhcp/Config.in +++ b/package/busybox/config/networking/udhcp/Config.in @@ -3,26 +3,26 @@ # see scripts/kbuild/config-language.txt. # -config BUSYBOX_CONFIG_UDHCPD +config BUSYBOX_CONFIG_APP_UDHCPD bool "udhcp server (udhcpd)" default n help udhcpd is a DHCP server geared primarily toward embedded systems, while striving to be fully functional and RFC compliant. -config BUSYBOX_CONFIG_DHCPRELAY +config BUSYBOX_CONFIG_APP_DHCPRELAY bool "dhcprelay" default n - depends on BUSYBOX_CONFIG_UDHCPD + depends on BUSYBOX_CONFIG_APP_UDHCPD help dhcprelay listens for dhcp requests on one or more interfaces and forwards these requests to a different interface or dhcp server. -config BUSYBOX_CONFIG_DUMPLEASES +config BUSYBOX_CONFIG_APP_DUMPLEASES bool "Lease display utility (dumpleases)" default n - depends on BUSYBOX_CONFIG_UDHCPD + depends on BUSYBOX_CONFIG_APP_UDHCPD help dumpleases displays the leases written out by the udhcpd server. Lease times are stored in the file by time remaining in lease, or @@ -31,7 +31,7 @@ config BUSYBOX_CONFIG_DUMPLEASES config BUSYBOX_CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY bool "Rewrite the lease file at every new acknowledge" default n - depends on BUSYBOX_CONFIG_UDHCPD + depends on BUSYBOX_CONFIG_APP_UDHCPD help If selected, udhcpd will write a new file with leases every time a new lease has been accepted, thus eliminating the need @@ -41,12 +41,12 @@ config BUSYBOX_CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY config BUSYBOX_CONFIG_DHCPD_LEASES_FILE string "Absolute path to lease file" default "/var/run/udhcpd.leases" - depends on BUSYBOX_CONFIG_UDHCPD + depends on BUSYBOX_CONFIG_APP_UDHCPD help udhcpd stores addresses in a lease file. This is the absolute path of the file. Normally it is safe to leave it untouched. -config BUSYBOX_CONFIG_UDHCPC +config BUSYBOX_CONFIG_APP_UDHCPC bool "udhcp client (udhcpc)" default y help @@ -59,7 +59,7 @@ config BUSYBOX_CONFIG_UDHCPC config BUSYBOX_CONFIG_FEATURE_UDHCPC_ARPING bool "Verify that the offered address is free, using ARP ping" default n - depends on BUSYBOX_CONFIG_UDHCPC + depends on BUSYBOX_CONFIG_APP_UDHCPC help If selected, udhcpc will send ARP probes and make sure the offered address is really not in use by anyone. The client @@ -69,7 +69,7 @@ config BUSYBOX_CONFIG_FEATURE_UDHCPC_ARPING config BUSYBOX_CONFIG_FEATURE_UDHCP_PORT bool "Enable '-P port' option for udhcpd and udhcpc" default n - depends on BUSYBOX_CONFIG_UDHCPD || BUSYBOX_CONFIG_UDHCPC + depends on BUSYBOX_CONFIG_APP_UDHCPD || BUSYBOX_CONFIG_APP_UDHCPC help At the cost of ~300 bytes, enables -P port option. This feature is typically not needed. @@ -78,7 +78,7 @@ config BUSYBOX_CONFIG_UDHCP_DEBUG int "Maximum verbosity level for udhcp applets (0..9)" default 0 range 0 9 - depends on BUSYBOX_CONFIG_UDHCPD || BUSYBOX_CONFIG_UDHCPC || BUSYBOX_CONFIG_DHCPRELAY + depends on BUSYBOX_CONFIG_APP_UDHCPD || BUSYBOX_CONFIG_APP_UDHCPC || BUSYBOX_CONFIG_APP_DHCPRELAY help Verbosity can be increased with multiple -v options. This options controls how high it can be cranked up. @@ -89,7 +89,7 @@ config BUSYBOX_CONFIG_UDHCP_DEBUG config BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397 bool "Support for RFC3397 domain search (experimental)" default y - depends on BUSYBOX_CONFIG_UDHCPD || BUSYBOX_CONFIG_UDHCPC + depends on BUSYBOX_CONFIG_APP_UDHCPD || BUSYBOX_CONFIG_APP_UDHCPC help If selected, both client and server will support passing of domain search lists via option 119, specified in RFC3397. @@ -97,7 +97,7 @@ config BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397 config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT string "Absolute path to config script" default "/usr/share/udhcpc/default.script" - depends on BUSYBOX_CONFIG_UDHCPC + depends on BUSYBOX_CONFIG_APP_UDHCPC help This script is called after udhcpc receives an answer. See examples/udhcp for a working example. Normally it is safe @@ -107,7 +107,7 @@ config BUSYBOX_CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS int "DHCP options slack buffer size" default 80 range 0 924 - depends on BUSYBOX_CONFIG_UDHCPD || BUSYBOX_CONFIG_UDHCPC + depends on BUSYBOX_CONFIG_APP_UDHCPD || BUSYBOX_CONFIG_APP_UDHCPC help Some buggy DHCP servers send DHCP offer packets with option field larger than we expect (which might also be considered a diff --git a/package/busybox/config/procps/Config.in b/package/busybox/config/procps/Config.in index 2bac03891..bd21cb377 100644 --- a/package/busybox/config/procps/Config.in +++ b/package/busybox/config/procps/Config.in @@ -188,13 +188,6 @@ config BUSYBOX_CONFIG_FEATURE_TOPMEM help Enable 's' in top (gives lots of memory info). -config BUSYBOX_CONFIG_FEATURE_SHOW_THREADS - bool "Support for showing threads in ps/top" - default n - depends on BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_TOP - help - Enables ps -T option and 'h' command in top - config BUSYBOX_CONFIG_UPTIME bool "uptime" default y @@ -210,4 +203,5 @@ config BUSYBOX_CONFIG_WATCH watch is used to execute a program periodically, showing output to the screen. + endmenu diff --git a/package/busybox/config/shell/Config.in b/package/busybox/config/shell/Config.in index 5d492e239..6ff3e3df4 100644 --- a/package/busybox/config/shell/Config.in +++ b/package/busybox/config/shell/Config.in @@ -15,7 +15,6 @@ choice config BUSYBOX_CONFIG_FEATURE_SH_IS_ASH select BUSYBOX_CONFIG_ASH bool "ash" - depends on !BUSYBOX_CONFIG_NOMMU config BUSYBOX_CONFIG_FEATURE_SH_IS_HUSH select BUSYBOX_CONFIG_HUSH @@ -37,7 +36,6 @@ endchoice config BUSYBOX_CONFIG_ASH bool "ash" default y - depends on !BUSYBOX_CONFIG_NOMMU help Tha 'ash' shell adds about 60k in the default configuration and is the most complete and most pedantically correct shell included with @@ -59,6 +57,23 @@ config BUSYBOX_CONFIG_ASH_JOB_CONTROL help Enable job control in the ash shell. +config BUSYBOX_CONFIG_ASH_READ_NCHARS + bool "'read -n N' and 'read -s' support" + default n + depends on BUSYBOX_CONFIG_ASH + help + 'read -n N' will return a value after N characters have been read. + 'read -s' will read without echoing the user's input. + +config BUSYBOX_CONFIG_ASH_READ_TIMEOUT + bool "'read -t S' support" + default y + depends on BUSYBOX_CONFIG_ASH + help + 'read -t S' will return a value after S seconds have passed. + This implementation will allow fractional seconds, expressed + as a decimal fraction, e.g. 'read -t 2.5 foo'. + config BUSYBOX_CONFIG_ASH_ALIAS bool "alias support" default y @@ -172,7 +187,7 @@ config BUSYBOX_CONFIG_HUSH_INTERACTIVE help Enable interactive mode (prompt and command editing). Without this, hush simply reads and executes commands - from stdin just like a shell script from a file. + from stdin just like a shell script from the file. No prompt, no PS1/PS2 magic shell variables. config BUSYBOX_CONFIG_HUSH_JOB @@ -235,14 +250,6 @@ config BUSYBOX_CONFIG_HUSH_EXPORT_N help Enable support for export '-n' option in hush. It is a bash extension. -config BUSYBOX_CONFIG_HUSH_RANDOM_SUPPORT - bool "Pseudorandom generator and $RANDOM variable" - default n - depends on BUSYBOX_CONFIG_HUSH - help - Enable pseudorandom generator and dynamic variable "$RANDOM". - Each read of "$RANDOM" will generate a new pseudorandom value. - config BUSYBOX_CONFIG_LASH bool "lash (deprecated: aliased to hush)" default n diff --git a/package/busybox/patches/000-autoconf.patch b/package/busybox/patches/000-autoconf.patch index 54f61c432..d0a6f6127 100644 --- a/package/busybox/patches/000-autoconf.patch +++ b/package/busybox/patches/000-autoconf.patch @@ -1,12 +1,12 @@ --- a/applets/Kbuild +++ b/applets/Kbuild -@@ -28,13 +28,13 @@ HOSTCFLAGS_usage_pod.o = -I$(srctree_sla +@@ -27,13 +27,13 @@ HOSTCFLAGS_usage.o = -I$(srctree_slash)i + applets/applets.o: include/usage_compressed.h include/applet_tables.h - applets/applet_tables: .config $(srctree_slash)include/applets.h --applets/usage: .config $(srctree_slash)include/applets.h -+applets/usage: .config $(srctree_slash)include/applets.h include/autoconf.h - applets/usage_pod: .config include/applet_tables.h $(srctree_slash)include/applets.h +-applets/usage: .config $(srctree_slash)applets/usage_compressed ++applets/usage: .config $(srctree_slash)applets/usage_compressed include/autoconf.h + applets/applet_tables: .config quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h cmd_gen_usage_compressed = $(srctree_slash)applets/usage_compressed include/usage_compressed.h applets diff --git a/package/busybox/patches/001-init_avoid_loop_opening_tty.patch b/package/busybox/patches/001-init_avoid_loop_opening_tty.patch index 6cf410df0..8f0ef1fc0 100644 --- a/package/busybox/patches/001-init_avoid_loop_opening_tty.patch +++ b/package/busybox/patches/001-init_avoid_loop_opening_tty.patch @@ -1,6 +1,6 @@ --- a/init/init.c +++ b/init/init.c -@@ -456,8 +456,11 @@ static void run_actions(int action_type) +@@ -451,8 +451,11 @@ static void run_actions(int action_type) /* Only run stuff with pid == 0. If pid != 0, * it is already running */ diff --git a/package/busybox/patches/110-wget_getopt_fix.patch b/package/busybox/patches/110-wget_getopt_fix.patch index 501f60848..617679eab 100644 --- a/package/busybox/patches/110-wget_getopt_fix.patch +++ b/package/busybox/patches/110-wget_getopt_fix.patch @@ -1,6 +1,6 @@ --- a/networking/wget.c +++ b/networking/wget.c -@@ -543,7 +543,7 @@ int wget_main(int argc UNUSED_PARAM, cha +@@ -653,7 +653,7 @@ int wget_main(int argc UNUSED_PARAM, cha // "tries\0" Required_argument "t" // "timeout\0" Required_argument "T" /* Ignored (we always use PASV): */ @@ -8,4 +8,4 @@ + "passive-ftp\0" No_argument "\xfd" "header\0" Required_argument "\xfe" "post-data\0" Required_argument "\xfd" - /* Ignored (we don't do ssl) */ + ; diff --git a/package/busybox/patches/250-ash_export-n.patch b/package/busybox/patches/250-ash_export-n.patch index c4bac4166..92b198ce5 100644 --- a/package/busybox/patches/250-ash_export-n.patch +++ b/package/busybox/patches/250-ash_export-n.patch @@ -1,6 +1,6 @@ --- a/shell/ash.c +++ b/shell/ash.c -@@ -12340,8 +12340,17 @@ exportcmd(int argc UNUSED_PARAM, char ** +@@ -12351,8 +12351,17 @@ exportcmd(int argc UNUSED_PARAM, char ** const char *p; char **aptr; int flag = argv[0][0] == 'r' ? VREADONLY : VEXPORT; @@ -19,7 +19,7 @@ aptr = argptr; name = *aptr; if (name) { -@@ -12353,10 +12362,12 @@ exportcmd(int argc UNUSED_PARAM, char ** +@@ -12364,10 +12373,12 @@ exportcmd(int argc UNUSED_PARAM, char ** vp = *findvar(hashvar(name), name); if (vp) { vp->flags |= flag; diff --git a/package/busybox/patches/300-netmsg.patch b/package/busybox/patches/300-netmsg.patch index 08e77ab47..aba146872 100644 --- a/package/busybox/patches/300-netmsg.patch +++ b/package/busybox/patches/300-netmsg.patch @@ -1,6 +1,6 @@ --- a/include/applets.h +++ b/include/applets.h -@@ -282,6 +282,7 @@ IF_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_D +@@ -278,6 +278,7 @@ IF_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_D IF_MV(APPLET(mv, _BB_DIR_BIN, _BB_SUID_DROP)) IF_NAMEIF(APPLET(nameif, _BB_DIR_SBIN, _BB_SUID_DROP)) IF_NC(APPLET(nc, _BB_DIR_USR_BIN, _BB_SUID_DROP)) @@ -10,7 +10,7 @@ IF_NMETER(APPLET(nmeter, _BB_DIR_USR_BIN, _BB_SUID_DROP)) --- a/include/usage.h +++ b/include/usage.h -@@ -3166,6 +3166,9 @@ +@@ -3101,6 +3101,9 @@ #endif @@ -22,7 +22,7 @@ #define netstat_full_usage "\n\n" \ --- a/networking/Config.in +++ b/networking/Config.in -@@ -628,6 +628,12 @@ config NC +@@ -617,6 +617,12 @@ config NC A simple Unix utility which reads and writes data across network connections. @@ -44,7 +44,7 @@ +lib-$(CONFIG_NETMSG) += netmsg.o lib-$(CONFIG_NETSTAT) += netstat.o lib-$(CONFIG_NSLOOKUP) += nslookup.o - lib-$(CONFIG_NTPD) += ntpd.o + lib-$(CONFIG_PING) += ping.o --- /dev/null +++ b/networking/netmsg.c @@ -0,0 +1,63 @@ diff --git a/package/busybox/patches/310-passwd_access.patch b/package/busybox/patches/310-passwd_access.patch index fef9d3a7a..6ab6d4b8c 100644 --- a/package/busybox/patches/310-passwd_access.patch +++ b/package/busybox/patches/310-passwd_access.patch @@ -3,7 +3,7 @@ --- a/networking/httpd.c +++ b/networking/httpd.c -@@ -1716,21 +1716,32 @@ static int check_user_passwd(const char +@@ -1699,21 +1699,32 @@ static int check_user_passwd(const char if (ENABLE_FEATURE_HTTPD_AUTH_MD5) { char *md5_passwd; diff --git a/package/busybox/patches/340-lock_util.patch b/package/busybox/patches/340-lock_util.patch index 05cf7e09a..3e9055862 100644 --- a/package/busybox/patches/340-lock_util.patch +++ b/package/busybox/patches/340-lock_util.patch @@ -1,6 +1,6 @@ --- a/include/applets.h +++ b/include/applets.h -@@ -234,6 +234,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, _BB_DIR_BIN, +@@ -233,6 +233,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, _BB_DIR_BIN, IF_LOAD_POLICY(APPLET(load_policy, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) IF_LOADFONT(APPLET(loadfont, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) IF_LOADKMAP(APPLET(loadkmap, _BB_DIR_SBIN, _BB_SUID_DROP)) @@ -10,7 +10,7 @@ IF_LOGNAME(APPLET_NOFORK(logname, logname, _BB_DIR_USR_BIN, _BB_SUID_DROP, logname)) --- a/include/usage.h +++ b/include/usage.h -@@ -2357,6 +2357,9 @@ +@@ -2325,6 +2325,9 @@ #define loadkmap_example_usage \ "$ loadkmap < /etc/i18n/lang-keymap\n" @@ -22,7 +22,7 @@ #define logger_full_usage "\n\n" \ --- a/miscutils/Config.in +++ b/miscutils/Config.in -@@ -463,6 +463,11 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA +@@ -456,6 +456,11 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA help Enables the 'hdparm -d' option to get/set using_dma flag. @@ -36,7 +36,7 @@ default n --- a/miscutils/Kbuild +++ b/miscutils/Kbuild -@@ -27,6 +27,7 @@ lib-$(CONFIG_INOTIFYD) += inotifyd.o +@@ -26,6 +26,7 @@ lib-$(CONFIG_INOTIFYD) += inotifyd.o lib-$(CONFIG_FEATURE_LAST_SMALL)+= last.o lib-$(CONFIG_FEATURE_LAST_FANCY)+= last_fancy.o lib-$(CONFIG_LESS) += less.o diff --git a/package/busybox/patches/350-httpd_redir.patch b/package/busybox/patches/350-httpd_redir.patch index bbb8eb4aa..3d3e041ce 100644 --- a/package/busybox/patches/350-httpd_redir.patch +++ b/package/busybox/patches/350-httpd_redir.patch @@ -1,6 +1,6 @@ --- a/include/usage.h +++ b/include/usage.h -@@ -1727,6 +1727,7 @@ +@@ -1693,6 +1693,7 @@ IF_FEATURE_HTTPD_BASIC_AUTH(" [-r REALM]") \ " [-h HOME]\n" \ "or httpd -d/-e" IF_FEATURE_HTTPD_AUTH_MD5("/-m") " STRING" @@ -8,18 +8,18 @@ #define httpd_full_usage "\n\n" \ "Listen for incoming HTTP requests\n" \ "\nOptions:" \ -@@ -1744,6 +1745,8 @@ +@@ -1710,6 +1711,8 @@ "\n -m STRING MD5 crypt STRING") \ "\n -e STRING HTML encode STRING" \ "\n -d STRING URL decode STRING" \ -+ "\n -R PATH Redirect target path" \ -+ "\n -H HOST Redirect target host" \ ++ "\n -R PATH Redirect target path" \ ++ "\n -H HOST Redirect target host" \ #define hwclock_trivial_usage \ IF_FEATURE_HWCLOCK_LONG_OPTIONS( \ --- a/networking/httpd.c +++ b/networking/httpd.c -@@ -250,6 +250,8 @@ struct globals { +@@ -248,6 +248,8 @@ struct globals { const char *found_mime_type; const char *found_moved_temporarily; @@ -28,7 +28,7 @@ Htaccess_IP *ip_a_d; /* config allow/deny lines */ IF_FEATURE_HTTPD_BASIC_AUTH(const char *g_realm;) -@@ -296,6 +298,8 @@ struct globals { +@@ -294,6 +296,8 @@ struct globals { #define index_page (G.index_page ) #define found_mime_type (G.found_mime_type ) #define found_moved_temporarily (G.found_moved_temporarily) @@ -37,7 +37,7 @@ #define last_mod (G.last_mod ) #define ip_a_d (G.ip_a_d ) #define g_realm (G.g_realm ) -@@ -997,8 +1001,11 @@ static void send_headers(int responseNum +@@ -993,8 +997,11 @@ static void send_headers(int responseNum } #endif if (responseNum == HTTP_MOVED_TEMPORARILY) { @@ -50,7 +50,7 @@ (g_query ? "?" : ""), (g_query ? g_query : "")); } -@@ -1941,8 +1948,12 @@ static void handle_incoming_and_exit(con +@@ -1924,8 +1931,12 @@ static void handle_incoming_and_exit(con } while (*++tptr); *++urlp = '\0'; /* terminate after last character */ @@ -61,10 +61,10 @@ /* If URL is a directory, add '/' */ - if (urlp[-1] != '/') { + if (!redirect_path && (urlp[-1] != '/')) { - if (is_directory(urlcopy + 1, 1, NULL)) { + if (is_directory(urlcopy + 1, 1, &sb)) { found_moved_temporarily = urlcopy; } -@@ -2283,7 +2294,9 @@ static void sighup_handler(int sig UNUSE +@@ -2266,7 +2277,9 @@ static void sighup_handler(int sig UNUSE } enum { @@ -75,7 +75,7 @@ d_opt_decode_url, h_opt_home_httpd, IF_FEATURE_HTTPD_ENCODE_URL_STR(e_opt_encode_url,) -@@ -2332,12 +2345,13 @@ int httpd_main(int argc UNUSED_PARAM, ch +@@ -2315,12 +2328,13 @@ int httpd_main(int argc UNUSED_PARAM, ch /* We do not "absolutize" path given by -h (home) opt. * If user gives relative path in -h, * $SCRIPT_FILENAME will not be set. */ diff --git a/package/busybox/patches/410-httpd_cgi_headers.patch b/package/busybox/patches/410-httpd_cgi_headers.patch index 74baa7ab9..2f464608f 100644 --- a/package/busybox/patches/410-httpd_cgi_headers.patch +++ b/package/busybox/patches/410-httpd_cgi_headers.patch @@ -1,6 +1,6 @@ --- a/networking/httpd.c +++ b/networking/httpd.c -@@ -1254,10 +1254,10 @@ static NOINLINE void cgi_io_loop_and_exi +@@ -1250,10 +1250,10 @@ static NOINLINE void cgi_io_loop_and_exi if (full_write(STDOUT_FILENO, HTTP_200, sizeof(HTTP_200)-1) != sizeof(HTTP_200)-1) break; } diff --git a/package/busybox/patches/440-httpd_chdir.patch b/package/busybox/patches/440-httpd_chdir.patch index 56f5bb68c..0abea5dc3 100644 --- a/package/busybox/patches/440-httpd_chdir.patch +++ b/package/busybox/patches/440-httpd_chdir.patch @@ -1,6 +1,6 @@ --- a/networking/httpd.c +++ b/networking/httpd.c -@@ -1827,6 +1827,7 @@ static void handle_incoming_and_exit(con +@@ -1810,6 +1810,7 @@ static void handle_incoming_and_exit(con char *header_ptr = header_ptr; Htaccess_Proxy *proxy_entry; #endif diff --git a/package/busybox/patches/470-insmod_search.patch b/package/busybox/patches/470-insmod_search.patch index 6f2da661b..022ca24e6 100644 --- a/package/busybox/patches/470-insmod_search.patch +++ b/package/busybox/patches/470-insmod_search.patch @@ -119,7 +119,7 @@ } --- a/modutils/Config.in +++ b/modutils/Config.in -@@ -226,7 +226,7 @@ config FEATURE_MODUTILS_SYMBOLS +@@ -210,7 +210,7 @@ config FEATURE_MODUTILS_SYMBOLS config DEFAULT_MODULES_DIR string "Default directory containing modules" default "/lib/modules" diff --git a/package/busybox/patches/480-mount_union.patch b/package/busybox/patches/480-mount_union.patch index b9eee8cb6..e520d781b 100644 --- a/package/busybox/patches/480-mount_union.patch +++ b/package/busybox/patches/480-mount_union.patch @@ -1,7 +1,7 @@ --- a/util-linux/mount.c +++ b/util-linux/mount.c -@@ -77,6 +77,10 @@ - # include +@@ -69,6 +69,10 @@ + #define MS_DIRSYNC 128 // Directory modifications are synchronous #endif +#ifndef MS_UNION @@ -11,7 +11,7 @@ #if defined(__dietlibc__) // 16.12.2006, Sampo Kellomaki (sampo@iki.fi) -@@ -194,6 +198,7 @@ static const int32_t mount_options[] = { +@@ -185,6 +189,7 @@ static const int32_t mount_options[] = { /* "rslave" */ MS_SLAVE|MS_RECURSIVE, /* "rprivate" */ MS_SLAVE|MS_RECURSIVE, /* "runbindable" */ MS_UNBINDABLE|MS_RECURSIVE, @@ -19,7 +19,7 @@ ) // Always understood. -@@ -249,6 +254,7 @@ static const char mount_option_str[] = +@@ -239,6 +244,7 @@ static const char mount_option_str[] = "rslave\0" "rprivate\0" "runbindable\0" diff --git a/package/busybox/patches/510-awk_include.patch b/package/busybox/patches/510-awk_include.patch index eda5beee9..b9d7d7137 100644 --- a/package/busybox/patches/510-awk_include.patch +++ b/package/busybox/patches/510-awk_include.patch @@ -15,7 +15,7 @@ } func; /* I/O stream */ -@@ -1424,7 +1429,8 @@ static void parse_program(char *p) +@@ -1420,7 +1425,8 @@ static void parse_program(char *p) next_token(TC_FUNCTION); g_pos++; f = newfunc(t_string); @@ -25,7 +25,7 @@ f->nargs = 0; while (next_token(TC_VARIABLE | TC_SEQTERM) & TC_VARIABLE) { v = findvar(ahash, t_string); -@@ -1433,7 +1439,7 @@ static void parse_program(char *p) +@@ -1429,7 +1435,7 @@ static void parse_program(char *p) if (next_token(TC_COMMA | TC_SEQTERM) & TC_SEQTERM) break; } @@ -34,7 +34,7 @@ chain_group(); clear_array(ahash); -@@ -2446,7 +2452,8 @@ static var *evaluate(node *op, var *res) +@@ -2410,7 +2416,8 @@ static var *evaluate(node *op, var *res) break; case XC( OC_FUNC ): @@ -43,8 +43,8 @@ + !op->r.f->x.body.first) syntax_error(EMSG_UNDEF_FUNC); - X.v = R.v = nvalloc(op->r.f->nargs + 1); -@@ -2463,7 +2470,10 @@ static var *evaluate(node *op, var *res) + X.v = R.v = nvalloc(op->r.f->nargs+1); +@@ -2427,7 +2434,10 @@ static var *evaluate(node *op, var *res) fnargs = X.v; L.s = g_progname; @@ -56,7 +56,7 @@ g_progname = L.s; nvfree(fnargs); -@@ -2829,6 +2839,143 @@ static rstream *next_input_file(void) +@@ -2790,6 +2800,143 @@ static rstream *next_input_file(void) #undef files_happen } @@ -200,7 +200,7 @@ int awk_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int awk_main(int argc, char **argv) { -@@ -2894,6 +3041,9 @@ int awk_main(int argc, char **argv) +@@ -2855,6 +3002,9 @@ int awk_main(int argc, char **argv) *s1 = '='; } } diff --git a/package/busybox/patches/902-telnetd_intr.patch b/package/busybox/patches/902-telnetd_intr.patch index 1e3e6bf2f..92a2d4725 100644 --- a/package/busybox/patches/902-telnetd_intr.patch +++ b/package/busybox/patches/902-telnetd_intr.patch @@ -1,6 +1,6 @@ --- a/networking/telnetd.c +++ b/networking/telnetd.c -@@ -308,6 +308,7 @@ make_new_session( +@@ -306,6 +306,7 @@ make_new_session( /* Restore default signal handling ASAP */ bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL); diff --git a/package/ifxmips-dsl-api/Makefile b/package/ifxmips-dsl-api/Makefile index a5cd221a5..1e19da23d 100644 --- a/package/ifxmips-dsl-api/Makefile +++ b/package/ifxmips-dsl-api/Makefile @@ -126,10 +126,8 @@ define Build/Prepare $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/mei/ $(CP) ./src/* $(PKG_BUILD_DIR)/src/mei/ $(Build/Patch) -ifeq ($(CONFIG_IFXMIPS_DSL_FIRMWARE),) $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(FW_BASE_NAME)_a-$(FW_A_VER).tar.gz $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(FW_BASE_NAME)_b-$(FW_B_VER).tar.gz -endif endef define Build/Configure diff --git a/package/kernel/modules/block.mk b/package/kernel/modules/block.mk index b3677c5de..7f3686d35 100644 --- a/package/kernel/modules/block.mk +++ b/package/kernel/modules/block.mk @@ -156,25 +156,6 @@ endef $(eval $(call KernelPackage,ata-magicbox-cf)) -define KernelPackage/ata-pdc202xx-old - SUBMENU:=$(BLOCK_MENU) - TITLE:=Older Promise PATA controller support - DEPENDS:=kmod-ata-core - KCONFIG:= \ - CONFIG_ATA_SFF=y \ - CONFIG_PATA_PDC_OLD - FILES:=$(LINUX_DIR)/drivers/ata/pata_pdc202xx_old.$(LINUX_KMOD_SUFFIX) - AUTOLOAD:=$(call AutoLoad,41,pata_pdc202xx_old,1) -endef - -define KernelPackage/ata-pdc202xx-old/description - This option enables support for the Promise 20246, 20262, 20263, - 20265 and 20267 adapters. -endef - -$(eval $(call KernelPackage,ata-pdc202xx-old)) - - define KernelPackage/ata-piix $(call KernelPackage/ata/Depends,) TITLE:=Intel PIIX PATA/SATA support diff --git a/package/kernel/modules/other.mk b/package/kernel/modules/other.mk index 97ce3d3b7..68d9c88e1 100644 --- a/package/kernel/modules/other.mk +++ b/package/kernel/modules/other.mk @@ -802,7 +802,7 @@ define KernelPackage/cs5535-gpio DEPENDS:=@TARGET_x86 KCONFIG:=CONFIG_CS5535_GPIO FILES:=$(LINUX_DIR)/drivers/char/cs5535_gpio.$(LINUX_KMOD_SUFFIX) - AUTOLOAD:=$(call AutoLoad,50,cs5535_gpio) + AUTOLOAD:=$(call AutoLoad,90,cs5535_gpio) endef define KernelPackage/cs5535-gpio/description @@ -875,34 +875,3 @@ define KernelPackage/rfkill/description endef $(eval $(call KernelPackage,rfkill)) - -define KernelPackage/geodewdt - SUBMENU:=$(OTHER_MENU) - TITLE:=Geode/LX Watchdog timer - DEPENDS:=@TARGET_x86 @LINUX_2_6 - KCONFIG:=CONFIG_GEODE_WDT - FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/geodewdt.$(LINUX_KMOD_SUFFIX) - AUTOLOAD:=$(call AutoLoad,50,geodewdt) -endef - -define KernelPackage/geodewdt/description - Kernel module for Geode watchdog timer. -endef - -$(eval $(call KernelPackage,geodewdt)) - -define KernelPackage/pc8736x-gpio - SUBMENU:=$(OTHER_MENU) - TITLE:=PC8736x GPIO support - DEPENDS:=@TARGET_x86 - KCONFIG:=CONFIG_PC8736x_GPIO - FILES:=$(LINUX_DIR)/drivers/char/pc8736x_gpio.$(LINUX_KMOD_SUFFIX) - AUTOLOAD:=$(call AutoLoad,40,pc8736x_gpio) -endef - -define KernelPackage/pc8736x-gpio/description - Kernel module for PC8736x GPIO -endef - -$(eval $(call KernelPackage,pc8736x-gpio)) - diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile index 2ea39c89a..ba4cda5df 100644 --- a/package/mac80211/Makefile +++ b/package/mac80211/Makefile @@ -10,12 +10,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=2010-04-13 -PKG_RELEASE:=1 +PKG_VERSION:=2010-03-24 +PKG_RELEASE:=5 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources # http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \ # http://wireless.kernel.org/download/compat-wireless-2.6 -PKG_MD5SUM:=d70715219e37214463c0e08974db80c1 +PKG_MD5SUM:=73357c52b5d6888ea3228b2ca8aa5eca PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) diff --git a/package/mac80211/patches/001-disable_b44.patch b/package/mac80211/patches/001-disable_b44.patch index 1869a5915..ce10e71bb 100644 --- a/package/mac80211/patches/001-disable_b44.patch +++ b/package/mac80211/patches/001-disable_b44.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -256,8 +256,8 @@ endif +@@ -269,8 +269,8 @@ endif CONFIG_P54_PCI=m diff --git a/package/mac80211/patches/002-disable_rfkill.patch b/package/mac80211/patches/002-disable_rfkill.patch index 9c6338a9a..2599dbb84 100644 --- a/package/mac80211/patches/002-disable_rfkill.patch +++ b/package/mac80211/patches/002-disable_rfkill.patch @@ -9,7 +9,7 @@ ifeq ($(CONFIG_MAC80211),y) $(error "ERROR: you have MAC80211 compiled into the kernel, CONFIG_MAC80211=y, as such you cannot replace its mac80211 driver. You need this set to CONFIG_MAC80211=m. If you are using Fedora upgrade your kernel as later version should this set as modular. For further information on Fedora see https://bugzilla.redhat.com/show_bug.cgi?id=470143. If you are using your own kernel recompile it and make mac80211 modular") -@@ -481,8 +481,8 @@ endif +@@ -492,8 +492,8 @@ endif # We need the backported rfkill module on kernel < 2.6.31. # In more recent kernel versions use the in kernel rfkill module. ifdef CONFIG_COMPAT_KERNEL_31 diff --git a/package/mac80211/patches/007-remove_misc_drivers.patch b/package/mac80211/patches/007-remove_misc_drivers.patch index e0b007fa4..a51a4b36e 100644 --- a/package/mac80211/patches/007-remove_misc_drivers.patch +++ b/package/mac80211/patches/007-remove_misc_drivers.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -286,10 +286,10 @@ endif +@@ -299,10 +299,10 @@ endif CONFIG_MWL8K=m # Ethernet drivers go here @@ -15,7 +15,7 @@ CONFIG_HERMES=m CONFIG_HERMES_CACHE_FW_ON_INIT=y -@@ -342,10 +342,10 @@ CONFIG_USB_NET_COMPAT_RNDIS_HOST=n +@@ -355,10 +355,10 @@ CONFIG_USB_NET_COMPAT_RNDIS_HOST=n CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n CONFIG_USB_NET_COMPAT_CDCETHER=n else diff --git a/package/mac80211/patches/010-no_pcmcia.patch b/package/mac80211/patches/010-no_pcmcia.patch index 0826df4f3..a9437ce8e 100644 --- a/package/mac80211/patches/010-no_pcmcia.patch +++ b/package/mac80211/patches/010-no_pcmcia.patch @@ -9,7 +9,7 @@ CONFIG_SSB=m else include $(KLIB_BUILD)/.config -@@ -181,7 +181,7 @@ CONFIG_B43=m +@@ -194,7 +194,7 @@ CONFIG_B43=m CONFIG_B43_HWRNG=y CONFIG_B43_PCI_AUTOSELECT=y ifneq ($(CONFIG_PCMCIA),) @@ -18,7 +18,7 @@ endif CONFIG_B43_LEDS=y CONFIG_B43_PHY_LP=y -@@ -233,7 +233,7 @@ CONFIG_SSB_BLOCKIO=y +@@ -246,7 +246,7 @@ CONFIG_SSB_BLOCKIO=y CONFIG_SSB_PCIHOST=y CONFIG_SSB_B43_PCI_BRIDGE=y ifneq ($(CONFIG_PCMCIA),) diff --git a/package/mac80211/patches/011-no_sdio.patch b/package/mac80211/patches/011-no_sdio.patch index 04a8029c3..bd6bdfe78 100644 --- a/package/mac80211/patches/011-no_sdio.patch +++ b/package/mac80211/patches/011-no_sdio.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -396,8 +396,8 @@ endif # end of SPI driver list +@@ -407,8 +407,8 @@ endif # end of SPI driver list ifneq ($(CONFIG_MMC),) diff --git a/package/mac80211/patches/013-disable_b43_nphy.patch b/package/mac80211/patches/013-disable_b43_nphy.patch index efdfb149a..747c52ab0 100644 --- a/package/mac80211/patches/013-disable_b43_nphy.patch +++ b/package/mac80211/patches/013-disable_b43_nphy.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -185,7 +185,7 @@ ifneq ($(CONFIG_PCMCIA),) +@@ -198,7 +198,7 @@ ifneq ($(CONFIG_PCMCIA),) endif CONFIG_B43_LEDS=y CONFIG_B43_PHY_LP=y diff --git a/package/mac80211/patches/014-add_iw_handler.patch b/package/mac80211/patches/014-add_iw_handler.patch new file mode 100644 index 000000000..5119b35fb --- /dev/null +++ b/package/mac80211/patches/014-add_iw_handler.patch @@ -0,0 +1,33 @@ +commit b7d48ccc687c44213121b1b565dccdc4488f5d9a +Author: Pavel Roskin +Date: Wed Mar 24 17:23:37 2010 -0400 + + compat: add compat-2.6.35.h and IW_HANDLER + + Signed-off-by: Pavel Roskin + +--- /dev/null ++++ b/include/linux/compat-2.6.35.h +@@ -0,0 +1,13 @@ ++#ifndef LINUX_26_35_COMPAT_H ++#define LINUX_26_35_COMPAT_H ++ ++#include ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) ++ ++#define IW_HANDLER(id, func) \ ++ [IW_IOCTL_IDX(id)] = func ++ ++#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */ ++ ++#endif /* LINUX_26_35_COMPAT_H */ +--- a/include/linux/compat-2.6.h ++++ b/include/linux/compat-2.6.h +@@ -27,5 +27,6 @@ + #include + #include + #include ++#include + + #endif /* LINUX_26_COMPAT_H */ diff --git a/package/mac80211/patches/015-remove-rt2x00-options.patch b/package/mac80211/patches/015-remove-rt2x00-options.patch index e62192bdf..f980979cc 100644 --- a/package/mac80211/patches/015-remove-rt2x00-options.patch +++ b/package/mac80211/patches/015-remove-rt2x00-options.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -248,12 +248,12 @@ CONFIG_RTL8180=m +@@ -276,12 +276,12 @@ CONFIG_RTL8180=m CONFIG_ADM8211=m @@ -15,7 +15,7 @@ # CONFIG_RT2800PCI_RT30XX=y # CONFIG_RT2800PCI_RT35XX=y # CONFIG_RT2800PCI_SOC=y -@@ -355,7 +355,7 @@ CONFIG_RT2800USB=m +@@ -381,7 +381,7 @@ CONFIG_RT2800USB=m # CONFIG_RT2800USB_RT35XX=y # CONFIG_RT2800USB_UNKNOWN=y endif diff --git a/package/mac80211/patches/300-fix-mesh.patch b/package/mac80211/patches/300-fix-mesh.patch new file mode 100644 index 000000000..554565615 --- /dev/null +++ b/package/mac80211/patches/300-fix-mesh.patch @@ -0,0 +1,45 @@ +From 181ce6f71d907f42ab73376ce154015a835a6d8a Mon Sep 17 00:00:00 2001 +From: Javier Cardona +Date: Mon, 29 Mar 2010 11:00:20 -0700 +Subject: [PATCH] mac80211: Handle mesh action frames in ieee80211_rx_h_action + +This fixes the problem introduced in commit +8404080568613d93ad7cf0a16dfb68 which broke mesh peer link establishment. + +changes: +v2 Added missing break (Johannes) +v3 Broke original patch into two (Johannes) + +Signed-off-by: Javier Cardona +Signed-off-by: Hauke Mehrtens +--- + net/mac80211/mesh.c | 3 --- + net/mac80211/rx.c | 5 +++++ + 2 files changed, 5 insertions(+), 3 deletions(-) + +--- a/net/mac80211/mesh.c ++++ b/net/mac80211/mesh.c +@@ -749,9 +749,6 @@ ieee80211_mesh_rx_mgmt(struct ieee80211_ + + switch (fc & IEEE80211_FCTL_STYPE) { + case IEEE80211_STYPE_ACTION: +- if (skb->len < IEEE80211_MIN_ACTION_SIZE) +- return RX_DROP_MONITOR; +- /* fall through */ + case IEEE80211_STYPE_PROBE_RESP: + case IEEE80211_STYPE_BEACON: + skb_queue_tail(&ifmsh->skb_queue, skb); +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -1964,6 +1964,11 @@ ieee80211_rx_h_action(struct ieee80211_r + goto handled; + } + break; ++ case MESH_PLINK_CATEGORY: ++ case MESH_PATH_SEL_CATEGORY: ++ if (ieee80211_vif_is_mesh(&sdata->vif)) ++ return ieee80211_mesh_rx_mgmt(sdata, rx->skb); ++ break; + } + + /* diff --git a/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch b/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch index 8098b22e2..e42be951c 100644 --- a/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch +++ b/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch @@ -1,14 +1,14 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -16,6 +16,7 @@ +@@ -15,6 +15,7 @@ + */ #include - #include +#include #include #include "hw.h" -@@ -431,8 +432,16 @@ static int ath9k_hw_init_macaddr(struct +@@ -441,8 +442,16 @@ static int ath9k_hw_init_macaddr(struct common->macaddr[2 * i] = eeval >> 8; common->macaddr[2 * i + 1] = eeval & 0xff; } diff --git a/package/mac80211/patches/404-ath_regd_optional.patch b/package/mac80211/patches/404-ath_regd_optional.patch index 5d4251c35..58ed4bdbe 100644 --- a/package/mac80211/patches/404-ath_regd_optional.patch +++ b/package/mac80211/patches/404-ath_regd_optional.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/regd.c +++ b/drivers/net/wireless/ath/regd.c -@@ -18,6 +18,9 @@ +@@ -19,6 +19,9 @@ #include #include #include "regd.h" diff --git a/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch b/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch index bbf46a0d2..560f8d42d 100644 --- a/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch +++ b/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch @@ -8,7 +8,7 @@ #include "ath9k.h" static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = { -@@ -53,21 +54,36 @@ static void ath_pci_read_cachesize(struc +@@ -52,21 +53,36 @@ static void ath_pci_read_cachesize(struc static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data) { diff --git a/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch b/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch index 19a29d916..799c1186f 100644 --- a/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch +++ b/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch @@ -1,3 +1,17 @@ +--- a/drivers/net/wireless/ath/ath9k/hw.c ++++ b/drivers/net/wireless/ath/ath9k/hw.c +@@ -385,11 +385,8 @@ static void ath9k_hw_init_defaults(struc + ah->hw_version.magic = AR5416_MAGIC; + ah->hw_version.subvendorid = 0; + +- ah->ah_flags = 0; + if (ah->hw_version.devid == AR5416_AR9100_DEVID) + ah->hw_version.macVersion = AR_SREV_VERSION_9100; +- if (!AR_SREV_9100(ah)) +- ah->ah_flags = AH_USE_EEPROM; + + ah->atim_window = 0; + ah->sta_id1_defaults = AR_STA_ID1_CRPT_MIC_ENABLE; --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -15,6 +15,7 @@ @@ -10,7 +24,7 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -542,6 +542,7 @@ static int ath9k_init_softc(u16 devid, s +@@ -531,6 +531,7 @@ static int ath9k_init_softc(u16 devid, s { struct ath_hw *ah = NULL; struct ath_common *common; @@ -18,7 +32,7 @@ int ret = 0, i; int csz = 0; -@@ -553,6 +554,10 @@ static int ath9k_init_softc(u16 devid, s +@@ -542,6 +543,10 @@ static int ath9k_init_softc(u16 devid, s ah->hw_version.subsysid = subsysid; sc->sc_ah = ah; @@ -29,16 +43,3 @@ common = ath9k_hw_common(ah); common->ops = &ath9k_common_ops; common->bus_ops = bus_ops; ---- a/drivers/net/wireless/ath/ath9k/hw.c -+++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -404,10 +404,6 @@ static void ath9k_hw_init_defaults(struc - ah->hw_version.magic = AR5416_MAGIC; - ah->hw_version.subvendorid = 0; - -- ah->ah_flags = 0; -- if (!AR_SREV_9100(ah)) -- ah->ah_flags = AH_USE_EEPROM; -- - ah->atim_window = 0; - ah->sta_id1_defaults = AR_STA_ID1_CRPT_MIC_ENABLE; - ah->beacon_interval = 100; diff --git a/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch b/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch index 999ced42d..93ad941b7 100644 --- a/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch +++ b/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch @@ -1,17 +1,17 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -17,8 +17,10 @@ +@@ -16,8 +16,10 @@ + #include - #include #include +#include #include +#include "ath9k.h" #include "hw.h" - #include "hw-ops.h" #include "rc.h" -@@ -416,18 +418,23 @@ static void ath9k_hw_init_defaults(struc + #include "initvals.h" +@@ -428,17 +430,23 @@ static int ath9k_hw_rf_claim(struct ath_ static int ath9k_hw_init_macaddr(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); @@ -20,11 +20,10 @@ u32 sum; int i; u16 eeval; - u32 EEP_MAC[] = { EEP_MAC_LSW, EEP_MAC_MID, EEP_MAC_MSW }; sum = 0; - for (i = 0; i < 3; i++) { -- eeval = ah->eep_ops->get_eeprom(ah, EEP_MAC[i]); +- eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i)); - sum += eeval; - common->macaddr[2 * i] = eeval >> 8; - common->macaddr[2 * i + 1] = eeval & 0xff; @@ -33,11 +32,12 @@ + memcpy(common->macaddr, pdata->macaddr, ETH_ALEN); + else + for (i = 0; i < 3; i++) { -+ eeval = ah->eep_ops->get_eeprom(ah, EEP_MAC[i]); ++ eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i)); + sum += eeval; + common->macaddr[2 * i] = eeval >> 8; + common->macaddr[2 * i + 1] = eeval & 0xff; + } ++ if (!is_valid_ether_addr(common->macaddr)) { ath_print(common, ATH_DBG_EEPROM, "eeprom contains invalid mac address: %pM\n", diff --git a/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch b/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch index 2d3f9246e..9d8ce1a33 100644 --- a/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch +++ b/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1298,7 +1298,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -2097,7 +2097,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st if (ah->config.rx_intr_mitigation) { REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500); @@ -8,4 +8,4 @@ + REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, 500); } - if (ah->config.tx_intr_mitigation) { + ath9k_hw_init_bb(ah, chan); diff --git a/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch b/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch index 1391da3c7..83eabaf09 100644 --- a/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch +++ b/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch @@ -1,14 +1,14 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -16,6 +16,7 @@ - - #include +@@ -14,6 +14,7 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +#include "linux/ath9k_platform.h" #include "ath9k.h" static char *dev_info = "ath9k"; -@@ -557,6 +558,8 @@ static int ath9k_init_softc(u16 devid, s +@@ -546,6 +547,8 @@ static int ath9k_init_softc(u16 devid, s pdata = (struct ath9k_platform_data *) sc->dev->platform_data; if (!pdata) ah->ah_flags |= AH_USE_EEPROM; @@ -17,7 +17,7 @@ common = ath9k_hw_common(ah); common->ops = &ath9k_common_ops; -@@ -679,6 +682,24 @@ void ath9k_set_hw_capab(struct ath_softc +@@ -671,6 +674,24 @@ void ath9k_set_hw_capab(struct ath_softc SET_IEEE80211_PERM_ADDR(hw, common->macaddr); } @@ -42,7 +42,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, const struct ath_bus_ops *bus_ops) { -@@ -697,6 +718,9 @@ int ath9k_init_device(u16 devid, struct +@@ -689,6 +710,9 @@ int ath9k_init_device(u16 devid, struct common = ath9k_hw_common(ah); ath9k_set_hw_capab(sc, hw); @@ -54,15 +54,15 @@ ath9k_reg_notifier); --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -517,6 +517,8 @@ struct ath_softc { - - int beacon_interval; - -+ bool quirk_wndr3700; +@@ -511,6 +511,8 @@ struct ath_softc { + struct ath_beacon_config cur_beacon_conf; + struct delayed_work tx_complete_work; + struct ath_btcoex btcoex; + - #ifdef CONFIG_ATH9K_DEBUGFS - struct ath9k_debug debug; - #endif ++ unsigned long quirk_wndr3700:1; + }; + + struct ath_wiphy { --- a/include/linux/ath9k_platform.h +++ b/include/linux/ath9k_platform.h @@ -24,6 +24,8 @@ @@ -70,7 +70,7 @@ u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; u8 *macaddr; + -+ bool quirk_wndr3700; ++ unsigned long quirk_wndr3700:1; }; #endif /* _LINUX_ATH9K_PLATFORM_H */ diff --git a/package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch b/package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch index c0e1e7f2e..c5cc6b7e1 100644 --- a/package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch +++ b/package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch @@ -13,7 +13,7 @@ sc->sc_ah->led_pin = ATH_LED_PIN_DEF; --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -392,6 +392,7 @@ void ath9k_btcoex_timer_pause(struct ath +@@ -379,6 +379,7 @@ void ath9k_btcoex_timer_pause(struct ath #define ATH_LED_PIN_DEF 1 #define ATH_LED_PIN_9287 8 diff --git a/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch b/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch index b5f035af7..eaed50091 100644 --- a/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch +++ b/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -78,6 +78,90 @@ static const struct file_operations fops +@@ -77,6 +77,90 @@ static const struct file_operations fops #define DMA_BUF_LEN 1024 @@ -91,7 +91,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { -@@ -731,6 +815,16 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -719,6 +803,16 @@ int ath9k_init_debug(struct ath_hw *ah) goto err; #endif @@ -108,7 +108,7 @@ sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_dma); if (!sc->debug.debugfs_dma) -@@ -781,6 +875,8 @@ void ath9k_exit_debug(struct ath_hw *ah) +@@ -769,6 +863,8 @@ void ath9k_exit_debug(struct ath_hw *ah) struct ath_common *common = ath9k_hw_common(ah); struct ath_softc *sc = (struct ath_softc *) common->priv; @@ -119,7 +119,7 @@ debugfs_remove(sc->debug.debugfs_wiphy); --- a/drivers/net/wireless/ath/ath9k/debug.h +++ b/drivers/net/wireless/ath/ath9k/debug.h -@@ -152,6 +152,8 @@ struct ath_stats { +@@ -148,6 +148,8 @@ struct ath_stats { }; struct ath9k_debug { diff --git a/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch b/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch index 3827ed9c2..dda4b88e8 100644 --- a/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch +++ b/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -795,6 +795,86 @@ static const struct file_operations fops +@@ -783,6 +783,86 @@ static const struct file_operations fops .owner = THIS_MODULE }; @@ -87,7 +87,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -864,6 +944,17 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -852,6 +932,17 @@ int ath9k_init_debug(struct ath_hw *ah) if (!sc->debug.debugfs_recv) goto err; @@ -105,7 +105,7 @@ return 0; err: ath9k_exit_debug(ah); -@@ -877,6 +968,8 @@ void ath9k_exit_debug(struct ath_hw *ah) +@@ -865,6 +956,8 @@ void ath9k_exit_debug(struct ath_hw *ah) debugfs_remove(sc->debug.debugfs_tx_chainmask); debugfs_remove(sc->debug.debugfs_rx_chainmask); @@ -116,7 +116,7 @@ debugfs_remove(sc->debug.debugfs_wiphy); --- a/drivers/net/wireless/ath/ath9k/debug.h +++ b/drivers/net/wireless/ath/ath9k/debug.h -@@ -162,6 +162,9 @@ struct ath9k_debug { +@@ -158,6 +158,9 @@ struct ath9k_debug { struct dentry *debugfs_wiphy; struct dentry *debugfs_xmit; struct dentry *debugfs_recv; diff --git a/package/mac80211/patches/540-ath9k_use_minstrel.patch b/package/mac80211/patches/540-ath9k_use_minstrel.patch index 72de38ee4..0983abf33 100644 --- a/package/mac80211/patches/540-ath9k_use_minstrel.patch +++ b/package/mac80211/patches/540-ath9k_use_minstrel.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -663,7 +663,11 @@ void ath9k_set_hw_capab(struct ath_softc +@@ -655,7 +655,11 @@ void ath9k_set_hw_capab(struct ath_softc hw->sta_data_size = sizeof(struct ath_node); hw->vif_data_size = sizeof(struct ath_vif); diff --git a/package/mac80211/patches/550-ath9k_bb_fix.patch b/package/mac80211/patches/550-ath9k_bb_fix.patch index e97bcacad..d09114c89 100644 --- a/package/mac80211/patches/550-ath9k_bb_fix.patch +++ b/package/mac80211/patches/550-ath9k_bb_fix.patch @@ -1,7 +1,7 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1131,6 +1131,34 @@ static bool ath9k_hw_channel_change(stru - return true; +@@ -1911,6 +1911,34 @@ static void ath9k_enable_rfkill(struct a + REG_SET_BIT(ah, AR_PHY_TEST, RFSILENT_BB); } +bool ath9k_hw_check_alive(struct ath_hw *ah) @@ -37,7 +37,7 @@ { --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h -@@ -846,6 +846,7 @@ void ath9k_hw_set11nmac2040(struct ath_h +@@ -679,6 +679,7 @@ void ath9k_hw_set11nmac2040(struct ath_h void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period); void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah, const struct ath9k_beacon_state *bs); @@ -47,7 +47,7 @@ --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -406,7 +406,8 @@ void ath9k_tasklet(unsigned long data) +@@ -405,7 +405,8 @@ void ath9k_tasklet(unsigned long data) ath9k_ps_wakeup(sc); diff --git a/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch b/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch index 834793d42..3971413b0 100644 --- a/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch +++ b/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c -@@ -224,6 +224,7 @@ void rt2x00pci_uninitialize(struct rt2x0 +@@ -223,6 +223,7 @@ void rt2x00pci_uninitialize(struct rt2x0 } EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize); @@ -8,7 +8,7 @@ /* * PCI driver handlers. */ -@@ -398,6 +399,7 @@ int rt2x00pci_resume(struct pci_dev *pci +@@ -397,6 +398,7 @@ int rt2x00pci_resume(struct pci_dev *pci } EXPORT_SYMBOL_GPL(rt2x00pci_resume); #endif /* CONFIG_PM */ diff --git a/package/mac80211/patches/601-rt2x00-lib-use-rt2x00dev-irq.patch b/package/mac80211/patches/601-rt2x00-lib-use-rt2x00dev-irq.patch index 1a793fa1f..22bfc2ebe 100644 --- a/package/mac80211/patches/601-rt2x00-lib-use-rt2x00dev-irq.patch +++ b/package/mac80211/patches/601-rt2x00-lib-use-rt2x00dev-irq.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c -@@ -214,7 +214,7 @@ void rt2x00pci_uninitialize(struct rt2x0 +@@ -213,7 +213,7 @@ void rt2x00pci_uninitialize(struct rt2x0 /* * Free irq line. */ diff --git a/package/mac80211/patches/602-rt2x00-remove-mcu-requests-for-soc.patch b/package/mac80211/patches/602-rt2x00-remove-mcu-requests-for-soc.patch index e743af3d3..9cecf3a03 100644 --- a/package/mac80211/patches/602-rt2x00-remove-mcu-requests-for-soc.patch +++ b/package/mac80211/patches/602-rt2x00-remove-mcu-requests-for-soc.patch @@ -1,29 +1,59 @@ -From f18d4463d092162f34a8bd226505627ceeac3e8a Mon Sep 17 00:00:00 2001 -From: Luis Correia -Date: Sat, 3 Apr 2010 12:49:53 +0100 -Subject: [PATCH] rt2x00: remove MCU requests for SoC platforms - The ralink SoC platforms do not have an MCU. Signed-off-by: Luis Correia -Acked-by: Ivo van Doorn -Signed-off-by: Gertjan van Wingerde --- - drivers/net/wireless/rt2x00/rt2800pci.c | 6 ++++++ - 1 files changed, 6 insertions(+), 0 deletions(-) ---- a/drivers/net/wireless/rt2x00/rt2800pci.c -+++ b/drivers/net/wireless/rt2x00/rt2800pci.c -@@ -66,6 +66,12 @@ static void rt2800pci_mcu_status(struct - if (rt2x00_is_soc(rt2x00dev)) +--- a/drivers/net/wireless/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c +@@ -221,9 +221,9 @@ void rt2800_mcu_request(struct rt2x00_de + u32 reg; + + /* +- * SOC devices don't support MCU requests. ++ * some devices don't support MCU requests. + */ +- if (rt2x00_is_soc(rt2x00dev)) ++ if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags)) return; + mutex_lock(&rt2x00dev->csr_mutex); +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -60,6 +60,12 @@ static void rt2800pci_mcu_status(struct + unsigned int i; + u32 reg; + + /* -+ * SOC devices don't support MCU requests. ++ * some devices don't support MCU requests. + */ -+ if (rt2x00_is_soc(rt2x00dev)) ++ if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags)) + return; + for (i = 0; i < 200; i++) { rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, ®); +@@ -1098,10 +1104,12 @@ static int rt2800pci_probe_hw(struct rt2 + __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags); + + /* +- * This device requires firmware. ++ * This device requires firmware and MCU access. + */ +- if (!rt2x00_is_soc(rt2x00dev)) ++ if (!rt2x00_is_soc(rt2x00dev)){ + __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); ++ __set_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags); ++ } + __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags); + __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags); + if (!modparam_nohwcrypt) +--- a/drivers/net/wireless/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/rt2x00/rt2x00.h +@@ -631,6 +631,7 @@ enum rt2x00_flags { + * Driver requirements + */ + DRIVER_REQUIRE_FIRMWARE, ++ DRIVER_REQUIRE_MCU, + DRIVER_REQUIRE_BEACON_GUARD, + DRIVER_REQUIRE_ATIM_QUEUE, + DRIVER_REQUIRE_DMA, diff --git a/package/uboot-lantiq/Makefile b/package/uboot-lantiq/Makefile index 8b69fe950..d2a9cf2ad 100644 --- a/package/uboot-lantiq/Makefile +++ b/package/uboot-lantiq/Makefile @@ -9,9 +9,8 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=u-boot - -PKG_VERSION:=2010.03 -PKG_MD5SUM:=2bf5ebf497dddc52440b1ea386cc1332 +PKG_VERSION:=2009.11.1 +PKG_MD5SUM:=6086421c9e2f3a0d0dbc5f706b551dbc PKG_RELEASE:=1 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/uboot-lantiq/patches/000-build-infos.patch b/package/uboot-lantiq/patches/000-build-infos.patch index 52d1ba749..2afcc4c12 100644 --- a/package/uboot-lantiq/patches/000-build-infos.patch +++ b/package/uboot-lantiq/patches/000-build-infos.patch @@ -7,10 +7,9 @@ $ make -s V=1 [CC] tools/img2srec.c [CC] tools/bmp_logo.c [CC] examples/hello_world.c - --- a/config.mk +++ b/config.mk -@@ -234,17 +234,42 @@ export TEXT_BASE PLATFORM_CPPFLAGS PLATF +@@ -206,17 +206,42 @@ export TEXT_BASE PLATFORM_CPPFLAGS PLATF ######################################################################### diff --git a/package/uboot-lantiq/patches/100-ifx_targets.patch b/package/uboot-lantiq/patches/100-ifx_targets.patch index 7033f913f..da4cd4864 100644 --- a/package/uboot-lantiq/patches/100-ifx_targets.patch +++ b/package/uboot-lantiq/patches/100-ifx_targets.patch @@ -1,6 +1,6 @@ --- a/MAKEALL +++ b/MAKEALL -@@ -730,6 +730,12 @@ LIST_arm=" \ +@@ -709,6 +709,12 @@ LIST_arm=" \ ## MIPS Systems (default = big endian) ######################################################################### @@ -13,7 +13,7 @@ LIST_mips4kc=" \ incaip \ qemu_mips \ -@@ -761,6 +767,7 @@ LIST_au1xx0=" \ +@@ -740,6 +746,7 @@ LIST_au1xx0=" \ " LIST_mips=" \ @@ -23,7 +23,7 @@ ${LIST_au1xx0} \ --- a/Makefile +++ b/Makefile -@@ -447,7 +447,7 @@ $(obj)include/autoconf.mk: $(obj)include +@@ -474,7 +474,7 @@ $(obj)include/autoconf.mk: $(obj)include set -e ; \ : Extract the config macros ; \ $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \ @@ -32,7 +32,7 @@ mv $@.tmp $@ ######################################################################### -@@ -3370,7 +3370,7 @@ incaip_config: unconfig +@@ -3354,7 +3354,7 @@ incaip_config: unconfig { echo "#define CPU_CLOCK_RATE 150000000" >>$(obj)include/config.h ; \ $(XECHO) "... with 150MHz system clock" ; \ } @@ -41,7 +41,7 @@ tb0229_config: unconfig @$(MKCONFIG) $(@:_config=) mips mips tb0229 -@@ -3411,6 +3411,50 @@ vct_platinumavc_onenand_small_config: un +@@ -3395,6 +3395,50 @@ vct_platinumavc_onenand_small_config: un @$(MKCONFIG) -a vct mips mips vct micronas ######################################################################### @@ -92,16 +92,6 @@ ## MIPS32 AU1X00 ######################################################################### ---- a/drivers/net/Makefile -+++ b/drivers/net/Makefile -@@ -43,6 +43,7 @@ COBJS-$(CONFIG_FEC_MXC) += fec_mxc.o - COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o - COBJS-$(CONFIG_FTMAC100) += ftmac100.o - COBJS-$(CONFIG_GRETH) += greth.o -+COBJS-$(CONFIG_IFX_ETOP) += ifx_etop.o - COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o - COBJS-$(CONFIG_KIRKWOOD_EGIGA) += kirkwood_egiga.o - COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -28,6 +28,7 @@ LIB := $(obj)libserial.a @@ -112,17 +102,27 @@ COBJS-$(CONFIG_MCFUART) += mcfuart.o COBJS-$(CONFIG_NS9750_UART) += ns9750_serial.o COBJS-$(CONFIG_SYS_NS16550) += ns16550.o +--- a/drivers/net/Makefile ++++ b/drivers/net/Makefile +@@ -41,6 +41,7 @@ COBJS-$(CONFIG_FEC_MXC) += fec_mxc.o + COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o + COBJS-$(CONFIG_FTMAC100) += ftmac100.o + COBJS-$(CONFIG_GRETH) += greth.o ++COBJS-$(CONFIG_IFX_ETOP) += ifx_etop.o + COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o + COBJS-$(CONFIG_KIRKWOOD_EGIGA) += kirkwood_egiga.o + COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o --- a/include/netdev.h +++ b/include/netdev.h -@@ -57,6 +57,7 @@ int fecmxc_initialize (bd_t *bis); +@@ -55,6 +55,7 @@ int fecmxc_initialize (bd_t *bis); int ftmac100_initialize(bd_t *bits); int greth_initialize(bd_t *bis); void gt6426x_eth_initialize(bd_t *bis); +int ifx_etop_initialize(bd_t *bis); int inca_switch_initialize(bd_t *bis); int kirkwood_egiga_initialize(bd_t *bis); - int lan91c96_initialize(u8 dev_num, int base_addr); -@@ -85,6 +86,7 @@ int uec_standard_init(bd_t *bis); + int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); +@@ -82,6 +83,7 @@ int uec_standard_init(bd_t *bis); int uli526x_initialize(bd_t *bis); int sh_eth_initialize(bd_t *bis); int dm9000_initialize(bd_t *bis); diff --git a/package/uboot-lantiq/patches/210-compile.patch b/package/uboot-lantiq/patches/210-compile.patch index c00230069..e34d7fd3e 100644 --- a/package/uboot-lantiq/patches/210-compile.patch +++ b/package/uboot-lantiq/patches/210-compile.patch @@ -1,5 +1,7 @@ ---- a/common/env_common.c -+++ b/common/env_common.c +Index: u-boot-2009.11.1/common/env_common.c +=================================================================== +--- u-boot-2009.11.1.orig/common/env_common.c 2010-01-25 09:35:12.000000000 +0100 ++++ u-boot-2009.11.1/common/env_common.c 2010-03-29 13:20:50.000000000 +0200 @@ -26,6 +26,7 @@ #include @@ -8,8 +10,10 @@ #include #include #include ---- a/common/env_embedded.c -+++ b/common/env_embedded.c +Index: u-boot-2009.11.1/common/env_embedded.c +=================================================================== +--- u-boot-2009.11.1.orig/common/env_embedded.c 2010-03-29 13:22:19.000000000 +0200 ++++ u-boot-2009.11.1/common/env_embedded.c 2010-03-29 13:22:29.000000000 +0200 @@ -27,6 +27,7 @@ #define __ASM_STUB_PROCESSOR_H__ /* don't include asm/processor. */ #include diff --git a/package/uboot-lantiq/patches/300-httpd.patch b/package/uboot-lantiq/patches/300-httpd.patch index 8c4c1ffb6..bc93ee61d 100644 --- a/package/uboot-lantiq/patches/300-httpd.patch +++ b/package/uboot-lantiq/patches/300-httpd.patch @@ -19,26 +19,6 @@ int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { return netboot_common (TFTP, cmdtp, argc, argv); ---- /dev/null -+++ b/include/httpd.h -@@ -0,0 +1,17 @@ -+#ifndef _UIP_HTTPD_H__ -+#define _UIP_HTTPD_H__ -+ -+void HttpdStart (void); -+void HttpdHandler (void); -+ -+/* board specific implementation */ -+extern int do_http_upgrade(const unsigned char *data, const ulong size); -+ -+#define HTTP_PROGRESS_START 0 -+#define HTTP_PROGRESS_TIMEOUT 1 -+#define HTTP_PROGRESS_UPLOAD_READY 2 -+#define HTTP_PROGRESS_UGRADE_READY 3 -+#define HTTP_PROGRESS_UGRADE_FAILED 4 -+extern int do_http_progress(const int state); -+ -+#endif --- a/include/net.h +++ b/include/net.h @@ -383,7 +383,8 @@ extern int NetTimeOffset; /* offset ti @@ -51,29 +31,6 @@ /* Shutdown adapters and cleanup */ extern void NetStop(void); ---- a/net/Makefile -+++ b/net/Makefile -@@ -26,6 +26,10 @@ include $(TOPDIR)/config.mk - # CFLAGS += -DDEBUG - - LIB = $(obj)libnet.a -+UIPDIR = uip-0.9 -+RSADIR = uip-0.9 -+$(shell mkdir -p $(obj)$(UIPDIR)) -+$(shell mkdir -p $(obj)$(RSADIR)) - - COBJS-$(CONFIG_CMD_NET) += bootp.o - COBJS-$(CONFIG_CMD_DNS) += dns.o -@@ -36,6 +40,9 @@ COBJS-$(CONFIG_CMD_NET) += rarp.o - COBJS-$(CONFIG_CMD_SNTP) += sntp.o - COBJS-$(CONFIG_CMD_NET) += tftp.o - -+COBJS-$(CONFIG_CMD_HTTPD) += httpd.o $(UIPDIR)/fs.o $(UIPDIR)/httpd.o $(UIPDIR)/uip_arp.o $(UIPDIR)/uip_arch.o $(UIPDIR)/uip.o -+COBJS-$(CONFIG_CMD_RSA) += $(RSADIR)/bigint.o $(RSADIR)/base64.o $(RSADIR)/rmd160.o $(RSADIR)/rsa.o -+ - COBJS := $(COBJS-y) - SRCS := $(COBJS:.o=.c) - OBJS := $(addprefix $(obj),$(COBJS)) --- /dev/null +++ b/net/httpd.c @@ -0,0 +1,52 @@ @@ -129,6 +86,49 @@ +} + +#endif +--- /dev/null ++++ b/include/httpd.h +@@ -0,0 +1,17 @@ ++#ifndef _UIP_HTTPD_H__ ++#define _UIP_HTTPD_H__ ++ ++void HttpdStart (void); ++void HttpdHandler (void); ++ ++/* board specific implementation */ ++extern int do_http_upgrade(const unsigned char *data, const ulong size); ++ ++#define HTTP_PROGRESS_START 0 ++#define HTTP_PROGRESS_TIMEOUT 1 ++#define HTTP_PROGRESS_UPLOAD_READY 2 ++#define HTTP_PROGRESS_UGRADE_READY 3 ++#define HTTP_PROGRESS_UGRADE_FAILED 4 ++extern int do_http_progress(const int state); ++ ++#endif +--- a/net/Makefile ++++ b/net/Makefile +@@ -26,6 +26,10 @@ include $(TOPDIR)/config.mk + # CFLAGS += -DDEBUG + + LIB = $(obj)libnet.a ++UIPDIR = uip-0.9 ++RSADIR = uip-0.9 ++$(shell mkdir -p $(obj)$(UIPDIR)) ++$(shell mkdir -p $(obj)$(RSADIR)) + + COBJS-y += bootp.o + COBJS-$(CONFIG_CMD_DNS) += dns.o +@@ -36,6 +40,9 @@ COBJS-y += rarp.o + COBJS-$(CONFIG_CMD_SNTP) += sntp.o + COBJS-y += tftp.o + ++COBJS-$(CONFIG_CMD_HTTPD) += httpd.o $(UIPDIR)/fs.o $(UIPDIR)/httpd.o $(UIPDIR)/uip_arp.o $(UIPDIR)/uip_arch.o $(UIPDIR)/uip.o ++COBJS-$(CONFIG_CMD_RSA) += $(RSADIR)/bigint.o $(RSADIR)/base64.o $(RSADIR)/rmd160.o $(RSADIR)/rsa.o ++ + COBJS := $(COBJS-y) + SRCS := $(COBJS:.o=.c) + OBJS := $(addprefix $(obj),$(COBJS)) --- a/net/net.c +++ b/net/net.c @@ -95,6 +95,19 @@ @@ -149,9 +149,9 @@ +extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +#endif - DECLARE_GLOBAL_DATA_PTR; + #if defined(CONFIG_CMD_NET) -@@ -1308,6 +1321,13 @@ NetReceive(volatile uchar * inpkt, int l +@@ -1310,6 +1323,13 @@ NetReceive(volatile uchar * inpkt, int l debug("packet received\n"); @@ -165,7 +165,7 @@ NetRxPacket = inpkt; NetRxPacketLen = len; et = (Ethernet_t *)inpkt; -@@ -1922,3 +1942,162 @@ ushort getenv_VLAN(char *var) +@@ -1952,3 +1972,162 @@ ushort getenv_VLAN(char *var) { return (string_to_VLAN(getenv(var))); } @@ -329,40 +329,6 @@ + +#endif --- /dev/null -+++ b/net/rsa/Makefile -@@ -0,0 +1,31 @@ -+# -+# FONRSA & FONSIGN libraries unit testing -+# -+# This file is part of FONUCS. Copyright (C) 2007 FON Wireless Ltd. -+# -+# Execute in this directory -+# -+# Created: 20070422 Pablo Martin Medrano -+# -+# $Id: Makefile 389 2007-06-11 08:29:56Z pablo.martin $ -+# -+# FIXME: Put this in the main Makefile.am -+# -+all: fonsign dump_key -+ -+fonsign: -+ gcc -g sign_openssl.c -D__MAINTEST__ -o fonsign -lssl -+ -+dump_key: -+ gcc -o dump_key dump_key.c -+ ./dump_key > public_key.h -+ -+foncheckrsa: -+ gcc -g bigint.c fonrsa.c rmd160.c foncheckrsa.c base64.c log.c -o foncheckrsa -+ -+#private_fon_rsa_key.pem: -+# openssl genrsa -out private_fon_rsa_key.pem 4096 -+# openssl rsa -in private_fon_rsa_key.pem -pubout -out public_fon_rsa_key.pem -+ -+clean: -+ rm fonsign dump_key ---- /dev/null +++ b/net/rsa/base64.c @@ -0,0 +1,137 @@ +#include "base64.h" @@ -2708,6 +2674,40 @@ +#endif + --- /dev/null ++++ b/net/rsa/Makefile +@@ -0,0 +1,31 @@ ++# ++# FONRSA & FONSIGN libraries unit testing ++# ++# This file is part of FONUCS. Copyright (C) 2007 FON Wireless Ltd. ++# ++# Execute in this directory ++# ++# Created: 20070422 Pablo Martin Medrano ++# ++# $Id: Makefile 389 2007-06-11 08:29:56Z pablo.martin $ ++# ++# FIXME: Put this in the main Makefile.am ++# ++all: fonsign dump_key ++ ++fonsign: ++ gcc -g sign_openssl.c -D__MAINTEST__ -o fonsign -lssl ++ ++dump_key: ++ gcc -o dump_key dump_key.c ++ ./dump_key > public_key.h ++ ++foncheckrsa: ++ gcc -g bigint.c fonrsa.c rmd160.c foncheckrsa.c base64.c log.c -o foncheckrsa ++ ++#private_fon_rsa_key.pem: ++# openssl genrsa -out private_fon_rsa_key.pem 4096 ++# openssl rsa -in private_fon_rsa_key.pem -pubout -out public_fon_rsa_key.pem ++ ++clean: ++ rm fonsign dump_key +--- /dev/null +++ b/net/rsa/public_key.h @@ -0,0 +1,52 @@ +unsigned char public_key[] = { @@ -4040,63 +4040,6 @@ +#endif + --- /dev/null -+++ b/net/uip-0.9/Makefile -@@ -0,0 +1,54 @@ -+# Copyright (c) 2001, Adam Dunkels. -+# All rights reserved. -+# -+# Redistribution and use in source and binary forms, with or without -+# modification, are permitted provided that the following conditions -+# are met: -+# 1. Redistributions of source code must retain the above copyright -+# notice, this list of conditions and the following disclaimer. -+# 2. Redistributions in binary form must reproduce the above copyright -+# notice, this list of conditions and the following disclaimer in the -+# documentation and/or other materials provided with the distribution. -+# 3. All advertising materials mentioning features or use of this software -+# must display the following acknowledgement: -+# This product includes software developed by Adam Dunkels. -+# 4. The name of the author may not be used to endorse or promote -+# products derived from this software without specific prior -+# written permission. -+# -+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -+# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+# -+# This file is part of the uIP TCP/IP stack. -+# -+# $Id: Makefile,v 1.8.2.2 2003/10/04 22:54:17 adam Exp $ -+# -+ -+CC=gcc -+CFLAGS=-Wall -fpack-struct -DDUMP=0 -+ -+all: uip -+ -+uip: uip.o uip_arch.o tapdev.o httpd.o main.o fs.o uip_arp.o -+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -+ -+%.o: %.c -+ $(CC) $(CFLAGS) -c $^ -o $@ -+ -+clean: -+ rm -f *.o *~ *core uip -+ -+ -+ -+ -+ -+ ---- /dev/null +++ b/net/uip-0.9/fs.c @@ -0,0 +1,154 @@ +/** @@ -4254,89 +4197,6 @@ +#endif /* FS_STATISTICS */ +/*-----------------------------------------------------------------------------------*/ --- /dev/null -+++ b/net/uip-0.9/fs.h -@@ -0,0 +1,80 @@ -+/** -+ * \addtogroup httpd -+ * @{ -+ */ -+ -+/** -+ * \file -+ * HTTP server read-only file system header file. -+ * \author Adam Dunkels -+ */ -+ -+/* -+ * Copyright (c) 2001, Swedish Institute of Computer Science. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the Institute nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * This file is part of the lwIP TCP/IP stack. -+ * -+ * Author: Adam Dunkels -+ * -+ * $Id: fs.h,v 1.6.2.3 2003/10/07 13:22:27 adam Exp $ -+ */ -+#ifndef __FS_H__ -+#define __FS_H__ -+ -+#include "uip.h" -+ -+/** -+ * An open file in the read-only file system. -+ */ -+struct fs_file { -+ char *data; /**< The actual file data. */ -+ int len; /**< The length of the file data. */ -+}; -+ -+/** -+ * Open a file in the read-only file system. -+ * -+ * \param name The name of the file. -+ * -+ * \param file The file pointer, which must be allocated by caller and -+ * will be filled in by the function. -+ */ -+int fs_open(const char *name, struct fs_file *file); -+ -+#ifdef FS_STATISTICS -+#if FS_STATISTICS == 1 -+u16_t fs_count(char *name); -+#endif /* FS_STATISTICS */ -+#endif /* FS_STATISTICS */ -+ -+/** -+ * Initialize the read-only file system. -+ */ -+void fs_init(void); -+ -+#endif /* __FS_H__ */ ---- /dev/null +++ b/net/uip-0.9/fsdata.c @@ -0,0 +1,199 @@ +static const char data_flashing_html[] = { @@ -4607,6 +4467,89 @@ + +#endif /* __FSDATA_H__ */ --- /dev/null ++++ b/net/uip-0.9/fs.h +@@ -0,0 +1,80 @@ ++/** ++ * \addtogroup httpd ++ * @{ ++ */ ++ ++/** ++ * \file ++ * HTTP server read-only file system header file. ++ * \author Adam Dunkels ++ */ ++ ++/* ++ * Copyright (c) 2001, Swedish Institute of Computer Science. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. Neither the name of the Institute nor the names of its contributors ++ * may be used to endorse or promote products derived from this software ++ * without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ * ++ * This file is part of the lwIP TCP/IP stack. ++ * ++ * Author: Adam Dunkels ++ * ++ * $Id: fs.h,v 1.6.2.3 2003/10/07 13:22:27 adam Exp $ ++ */ ++#ifndef __FS_H__ ++#define __FS_H__ ++ ++#include "uip.h" ++ ++/** ++ * An open file in the read-only file system. ++ */ ++struct fs_file { ++ char *data; /**< The actual file data. */ ++ int len; /**< The length of the file data. */ ++}; ++ ++/** ++ * Open a file in the read-only file system. ++ * ++ * \param name The name of the file. ++ * ++ * \param file The file pointer, which must be allocated by caller and ++ * will be filled in by the function. ++ */ ++int fs_open(const char *name, struct fs_file *file); ++ ++#ifdef FS_STATISTICS ++#if FS_STATISTICS == 1 ++u16_t fs_count(char *name); ++#endif /* FS_STATISTICS */ ++#endif /* FS_STATISTICS */ ++ ++/** ++ * Initialize the read-only file system. ++ */ ++void fs_init(void); ++ ++#endif /* __FS_H__ */ +--- /dev/null +++ b/net/uip-0.9/httpd.c @@ -0,0 +1,278 @@ +#include "uip.h" @@ -5065,6 +5008,63 @@ + return 0; +} --- /dev/null ++++ b/net/uip-0.9/Makefile +@@ -0,0 +1,54 @@ ++# Copyright (c) 2001, Adam Dunkels. ++# All rights reserved. ++# ++# Redistribution and use in source and binary forms, with or without ++# modification, are permitted provided that the following conditions ++# are met: ++# 1. Redistributions of source code must retain the above copyright ++# notice, this list of conditions and the following disclaimer. ++# 2. Redistributions in binary form must reproduce the above copyright ++# notice, this list of conditions and the following disclaimer in the ++# documentation and/or other materials provided with the distribution. ++# 3. All advertising materials mentioning features or use of this software ++# must display the following acknowledgement: ++# This product includes software developed by Adam Dunkels. ++# 4. The name of the author may not be used to endorse or promote ++# products derived from this software without specific prior ++# written permission. ++# ++# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ++# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ++# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ++# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ++# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ++# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++# ++# This file is part of the uIP TCP/IP stack. ++# ++# $Id: Makefile,v 1.8.2.2 2003/10/04 22:54:17 adam Exp $ ++# ++ ++CC=gcc ++CFLAGS=-Wall -fpack-struct -DDUMP=0 ++ ++all: uip ++ ++uip: uip.o uip_arch.o tapdev.o httpd.o main.o fs.o uip_arp.o ++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ ++ ++%.o: %.c ++ $(CC) $(CFLAGS) -c $^ -o $@ ++ ++clean: ++ rm -f *.o *~ *core uip ++ ++ ++ ++ ++ ++ +--- /dev/null +++ b/net/uip-0.9/tapdev.c @@ -0,0 +1,192 @@ +/* @@ -5305,6 +5305,915 @@ + +#endif /* __TAPDEV_H__ */ --- /dev/null ++++ b/net/uip-0.9/uip_arch.c +@@ -0,0 +1,145 @@ ++/* ++ * Copyright (c) 2001, Adam Dunkels. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote ++ * products derived from this software without specific prior ++ * written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ++ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ++ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ++ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ++ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * This file is part of the uIP TCP/IP stack. ++ * ++ * $Id: uip_arch.c,v 1.2.2.1 2003/10/04 22:54:17 adam Exp $ ++ * ++ */ ++ ++ ++#include "uip.h" ++#include "uip_arch.h" ++ ++#define BUF ((uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) ++#define IP_PROTO_TCP 6 ++ ++/*-----------------------------------------------------------------------------------*/ ++void ++uip_add32(u8_t *op32, u16_t op16) ++{ ++ ++ uip_acc32[3] = op32[3] + (op16 & 0xff); ++ uip_acc32[2] = op32[2] + (op16 >> 8); ++ uip_acc32[1] = op32[1]; ++ uip_acc32[0] = op32[0]; ++ ++ if(uip_acc32[2] < (op16 >> 8)) { ++ ++uip_acc32[1]; ++ if(uip_acc32[1] == 0) { ++ ++uip_acc32[0]; ++ } ++ } ++ ++ ++ if(uip_acc32[3] < (op16 & 0xff)) { ++ ++uip_acc32[2]; ++ if(uip_acc32[2] == 0) { ++ ++uip_acc32[1]; ++ if(uip_acc32[1] == 0) { ++ ++uip_acc32[0]; ++ } ++ } ++ } ++} ++/*-----------------------------------------------------------------------------------*/ ++u16_t ++uip_chksum(u16_t *sdata, u16_t len) ++{ ++ u16_t acc; ++ ++ for(acc = 0; len > 1; len -= 2) { ++ acc += *sdata; ++ if(acc < *sdata) { ++ /* Overflow, so we add the carry to acc (i.e., increase by ++ one). */ ++ ++acc; ++ } ++ ++sdata; ++ } ++ ++ /* add up any odd byte */ ++ if(len == 1) { ++ acc += htons(((u16_t)(*(u8_t *)sdata)) << 8); ++ if(acc < htons(((u16_t)(*(u8_t *)sdata)) << 8)) { ++ ++acc; ++ } ++ } ++ ++ return acc; ++} ++/*-----------------------------------------------------------------------------------*/ ++u16_t ++uip_ipchksum(void) ++{ ++ return uip_chksum((u16_t *)&uip_buf[UIP_LLH_LEN], 20); ++} ++/*-----------------------------------------------------------------------------------*/ ++u16_t ++uip_tcpchksum(void) ++{ ++ u16_t hsum, sum; ++ ++ ++ /* Compute the checksum of the TCP header. */ ++ hsum = uip_chksum((u16_t *)&uip_buf[20 + UIP_LLH_LEN], 20); ++ ++ /* Compute the checksum of the data in the TCP packet and add it to ++ the TCP header checksum. */ ++ sum = uip_chksum((u16_t *)uip_appdata, ++ (u16_t)(((((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - 40))); ++ ++ if((sum += hsum) < hsum) { ++ ++sum; ++ } ++ ++ if((sum += BUF->srcipaddr[0]) < BUF->srcipaddr[0]) { ++ ++sum; ++ } ++ if((sum += BUF->srcipaddr[1]) < BUF->srcipaddr[1]) { ++ ++sum; ++ } ++ if((sum += BUF->destipaddr[0]) < BUF->destipaddr[0]) { ++ ++sum; ++ } ++ if((sum += BUF->destipaddr[1]) < BUF->destipaddr[1]) { ++ ++sum; ++ } ++ if((sum += (u16_t)htons((u16_t)IP_PROTO_TCP)) < (u16_t)htons((u16_t)IP_PROTO_TCP)) { ++ ++sum; ++ } ++ ++ hsum = (u16_t)htons((((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - 20); ++ ++ if((sum += hsum) < hsum) { ++ ++sum; ++ } ++ ++ return sum; ++} ++/*-----------------------------------------------------------------------------------*/ +--- /dev/null ++++ b/net/uip-0.9/uip_arch.h +@@ -0,0 +1,130 @@ ++/** ++ * \defgroup uiparch Architecture specific uIP functions ++ * @{ ++ * ++ * The functions in the architecture specific module implement the IP ++ * check sum and 32-bit additions. ++ * ++ * The IP checksum calculation is the most computationally expensive ++ * operation in the TCP/IP stack and it therefore pays off to ++ * implement this in efficient assembler. The purpose of the uip-arch ++ * module is to let the checksum functions to be implemented in ++ * architecture specific assembler. ++ * ++ */ ++ ++/** ++ * \file ++ * Declarations of architecture specific functions. ++ * \author Adam Dunkels ++ */ ++ ++/* ++ * Copyright (c) 2001, Adam Dunkels. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote ++ * products derived from this software without specific prior ++ * written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ++ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ++ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ++ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ++ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * This file is part of the uIP TCP/IP stack. ++ * ++ * $Id: uip_arch.h,v 1.1.2.2 2003/10/06 15:10:22 adam Exp $ ++ * ++ */ ++ ++#ifndef __UIP_ARCH_H__ ++#define __UIP_ARCH_H__ ++ ++#include "uip.h" ++ ++/** ++ * Carry out a 32-bit addition. ++ * ++ * Because not all architectures for which uIP is intended has native ++ * 32-bit arithmetic, uIP uses an external C function for doing the ++ * required 32-bit additions in the TCP protocol processing. This ++ * function should add the two arguments and place the result in the ++ * global variable uip_acc32. ++ * ++ * \note The 32-bit integer pointed to by the op32 parameter and the ++ * result in the uip_acc32 variable are in network byte order (big ++ * endian). ++ * ++ * \param op32 A pointer to a 4-byte array representing a 32-bit ++ * integer in network byte order (big endian). ++ * ++ * \param op16 A 16-bit integer in host byte order. ++ */ ++void uip_add32(u8_t *op32, u16_t op16); ++ ++/** ++ * Calculate the Internet checksum over a buffer. ++ * ++ * The Internet checksum is the one's complement of the one's ++ * complement sum of all 16-bit words in the buffer. ++ * ++ * See RFC1071. ++ * ++ * \note This function is not called in the current version of uIP, ++ * but future versions might make use of it. ++ * ++ * \param buf A pointer to the buffer over which the checksum is to be ++ * computed. ++ * ++ * \param len The length of the buffer over which the checksum is to ++ * be computed. ++ * ++ * \return The Internet checksum of the buffer. ++ */ ++u16_t uip_chksum(u16_t *buf, u16_t len); ++ ++/** ++ * Calculate the IP header checksum of the packet header in uip_buf. ++ * ++ * The IP header checksum is the Internet checksum of the 20 bytes of ++ * the IP header. ++ * ++ * \return The IP header checksum of the IP header in the uip_buf ++ * buffer. ++ */ ++u16_t uip_ipchksum(void); ++ ++/** ++ * Calculate the TCP checksum of the packet in uip_buf and uip_appdata. ++ * ++ * The TCP checksum is the Internet checksum of data contents of the ++ * TCP segment, and a pseudo-header as defined in RFC793. ++ * ++ * \note The uip_appdata pointer that points to the packet data may ++ * point anywhere in memory, so it is not possible to simply calculate ++ * the Internet checksum of the contents of the uip_buf buffer. ++ * ++ * \return The TCP checksum of the TCP segment in uip_buf and pointed ++ * to by uip_appdata. ++ */ ++u16_t uip_tcpchksum(void); ++ ++/** @} */ ++ ++#endif /* __UIP_ARCH_H__ */ +--- /dev/null ++++ b/net/uip-0.9/uip_arp.c +@@ -0,0 +1,421 @@ ++/** ++ * \addtogroup uip ++ * @{ ++ */ ++ ++/** ++ * \defgroup uiparp uIP Address Resolution Protocol ++ * @{ ++ * ++ * The Address Resolution Protocol ARP is used for mapping between IP ++ * addresses and link level addresses such as the Ethernet MAC ++ * addresses. ARP uses broadcast queries to ask for the link level ++ * address of a known IP address and the host which is configured with ++ * the IP address for which the query was meant, will respond with its ++ * link level address. ++ * ++ * \note This ARP implementation only supports Ethernet. ++ */ ++ ++/** ++ * \file ++ * Implementation of the ARP Address Resolution Protocol. ++ * \author Adam Dunkels ++ * ++ */ ++ ++/* ++ * Copyright (c) 2001-2003, Adam Dunkels. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote ++ * products derived from this software without specific prior ++ * written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ++ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ++ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ++ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ++ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * This file is part of the uIP TCP/IP stack. ++ * ++ * $Id: uip_arp.c,v 1.7.2.3 2003/10/06 22:42:30 adam Exp $ ++ * ++ */ ++ ++ ++#include "uip_arp.h" ++ ++struct arp_hdr { ++ struct uip_eth_hdr ethhdr; ++ u16_t hwtype; ++ u16_t protocol; ++ u8_t hwlen; ++ u8_t protolen; ++ u16_t opcode; ++ struct uip_eth_addr shwaddr; ++ u16_t sipaddr[2]; ++ struct uip_eth_addr dhwaddr; ++ u16_t dipaddr[2]; ++}; ++ ++struct ethip_hdr { ++ struct uip_eth_hdr ethhdr; ++ /* IP header. */ ++ u8_t vhl, ++ tos, ++ len[2], ++ ipid[2], ++ ipoffset[2], ++ ttl, ++ proto; ++ u16_t ipchksum; ++ u16_t srcipaddr[2], ++ destipaddr[2]; ++}; ++ ++#define ARP_REQUEST 1 ++#define ARP_REPLY 2 ++ ++#define ARP_HWTYPE_ETH 1 ++ ++struct arp_entry { ++ u16_t ipaddr[2]; ++ struct uip_eth_addr ethaddr; ++ u8_t time; ++}; ++ ++struct uip_eth_addr uip_ethaddr = {{UIP_ETHADDR0, ++ UIP_ETHADDR1, ++ UIP_ETHADDR2, ++ UIP_ETHADDR3, ++ UIP_ETHADDR4, ++ UIP_ETHADDR5}}; ++ ++static struct arp_entry arp_table[UIP_ARPTAB_SIZE]; ++static u16_t ipaddr[2]; ++static u8_t i, c; ++ ++static u8_t arptime; ++static u8_t tmpage; ++ ++#define BUF ((struct arp_hdr *)&uip_buf[0]) ++#define IPBUF ((struct ethip_hdr *)&uip_buf[0]) ++/*-----------------------------------------------------------------------------------*/ ++/** ++ * Initialize the ARP module. ++ * ++ */ ++/*-----------------------------------------------------------------------------------*/ ++void ++uip_arp_init(void) ++{ ++ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { ++ memset(arp_table[i].ipaddr, 0, 4); ++ } ++} ++/*-----------------------------------------------------------------------------------*/ ++/** ++ * Periodic ARP processing function. ++ * ++ * This function performs periodic timer processing in the ARP module ++ * and should be called at regular intervals. The recommended interval ++ * is 10 seconds between the calls. ++ * ++ */ ++/*-----------------------------------------------------------------------------------*/ ++void ++uip_arp_timer(void) ++{ ++ struct arp_entry *tabptr; ++ ++ ++arptime; ++ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { ++ tabptr = &arp_table[i]; ++ if((tabptr->ipaddr[0] | tabptr->ipaddr[1]) != 0 && ++ arptime - tabptr->time >= UIP_ARP_MAXAGE) { ++ memset(tabptr->ipaddr, 0, 4); ++ } ++ } ++ ++} ++/*-----------------------------------------------------------------------------------*/ ++static void ++uip_arp_update(u16_t *ipaddr, struct uip_eth_addr *ethaddr) ++{ ++ register struct arp_entry *tabptr; ++ /* Walk through the ARP mapping table and try to find an entry to ++ update. If none is found, the IP -> MAC address mapping is ++ inserted in the ARP table. */ ++ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { ++ ++ tabptr = &arp_table[i]; ++ /* Only check those entries that are actually in use. */ ++ if(tabptr->ipaddr[0] != 0 && ++ tabptr->ipaddr[1] != 0) { ++ ++ /* Check if the source IP address of the incoming packet matches ++ the IP address in this ARP table entry. */ ++ if(ipaddr[0] == tabptr->ipaddr[0] && ++ ipaddr[1] == tabptr->ipaddr[1]) { ++ ++ /* An old entry found, update this and return. */ ++ memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6); ++ tabptr->time = arptime; ++ ++ return; ++ } ++ } ++ } ++ ++ /* If we get here, no existing ARP table entry was found, so we ++ create one. */ ++ ++ /* First, we try to find an unused entry in the ARP table. */ ++ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { ++ tabptr = &arp_table[i]; ++ if(tabptr->ipaddr[0] == 0 && ++ tabptr->ipaddr[1] == 0) { ++ break; ++ } ++ } ++ ++ /* If no unused entry is found, we try to find the oldest entry and ++ throw it away. */ ++ if(i == UIP_ARPTAB_SIZE) { ++ tmpage = 0; ++ c = 0; ++ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { ++ tabptr = &arp_table[i]; ++ if(arptime - tabptr->time > tmpage) { ++ tmpage = arptime - tabptr->time; ++ c = i; ++ } ++ } ++ i = c; ++ } ++ ++ /* Now, i is the ARP table entry which we will fill with the new ++ information. */ ++ memcpy(tabptr->ipaddr, ipaddr, 4); ++ memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6); ++ tabptr->time = arptime; ++} ++/*-----------------------------------------------------------------------------------*/ ++/** ++ * ARP processing for incoming IP packets ++ * ++ * This function should be called by the device driver when an IP ++ * packet has been received. The function will check if the address is ++ * in the ARP cache, and if so the ARP cache entry will be ++ * refreshed. If no ARP cache entry was found, a new one is created. ++ * ++ * This function expects an IP packet with a prepended Ethernet header ++ * in the uip_buf[] buffer, and the length of the packet in the global ++ * variable uip_len. ++ */ ++/*-----------------------------------------------------------------------------------*/ ++void ++uip_arp_ipin(void) ++{ ++ uip_len -= sizeof(struct uip_eth_hdr); ++ ++ /* Only insert/update an entry if the source IP address of the ++ incoming IP packet comes from a host on the local network. */ ++ if((IPBUF->srcipaddr[0] & uip_arp_netmask[0]) != ++ (uip_hostaddr[0] & uip_arp_netmask[0])) { ++ return; ++ } ++ if((IPBUF->srcipaddr[1] & uip_arp_netmask[1]) != ++ (uip_hostaddr[1] & uip_arp_netmask[1])) { ++ return; ++ } ++ uip_arp_update(IPBUF->srcipaddr, &(IPBUF->ethhdr.src)); ++ ++ return; ++} ++/*-----------------------------------------------------------------------------------*/ ++/** ++ * ARP processing for incoming ARP packets. ++ * ++ * This function should be called by the device driver when an ARP ++ * packet has been received. The function will act differently ++ * depending on the ARP packet type: if it is a reply for a request ++ * that we previously sent out, the ARP cache will be filled in with ++ * the values from the ARP reply. If the incoming ARP packet is an ARP ++ * request for our IP address, an ARP reply packet is created and put ++ * into the uip_buf[] buffer. ++ * ++ * When the function returns, the value of the global variable uip_len ++ * indicates whether the device driver should send out a packet or ++ * not. If uip_len is zero, no packet should be sent. If uip_len is ++ * non-zero, it contains the length of the outbound packet that is ++ * present in the uip_buf[] buffer. ++ * ++ * This function expects an ARP packet with a prepended Ethernet ++ * header in the uip_buf[] buffer, and the length of the packet in the ++ * global variable uip_len. ++ */ ++/*-----------------------------------------------------------------------------------*/ ++void ++uip_arp_arpin(void) ++{ ++ ++ if(uip_len < sizeof(struct arp_hdr)) { ++ uip_len = 0; ++ return; ++ } ++ ++ uip_len = 0; ++ ++ switch(BUF->opcode) { ++ case HTONS(ARP_REQUEST): ++ /* ARP request. If it asked for our address, we send out a ++ reply. */ ++ if(BUF->dipaddr[0] == uip_hostaddr[0] && ++ BUF->dipaddr[1] == uip_hostaddr[1]) { ++ /* The reply opcode is 2. */ ++ BUF->opcode = HTONS(2); ++ ++ memcpy(BUF->dhwaddr.addr, BUF->shwaddr.addr, 6); ++ memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6); ++ memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6); ++ memcpy(BUF->ethhdr.dest.addr, BUF->dhwaddr.addr, 6); ++ ++ BUF->dipaddr[0] = BUF->sipaddr[0]; ++ BUF->dipaddr[1] = BUF->sipaddr[1]; ++ BUF->sipaddr[0] = uip_hostaddr[0]; ++ BUF->sipaddr[1] = uip_hostaddr[1]; ++ ++ BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP); ++ uip_len = sizeof(struct arp_hdr); ++ } ++ break; ++ case HTONS(ARP_REPLY): ++ /* ARP reply. We insert or update the ARP table if it was meant ++ for us. */ ++ if(BUF->dipaddr[0] == uip_hostaddr[0] && ++ BUF->dipaddr[1] == uip_hostaddr[1]) { ++ ++ uip_arp_update(BUF->sipaddr, &BUF->shwaddr); ++ } ++ break; ++ } ++ ++ return; ++} ++/*-----------------------------------------------------------------------------------*/ ++/** ++ * Prepend Ethernet header to an outbound IP packet and see if we need ++ * to send out an ARP request. ++ * ++ * This function should be called before sending out an IP packet. The ++ * function checks the destination IP address of the IP packet to see ++ * what Ethernet MAC address that should be used as a destination MAC ++ * address on the Ethernet. ++ * ++ * If the destination IP address is in the local network (determined ++ * by logical ANDing of netmask and our IP address), the function ++ * checks the ARP cache to see if an entry for the destination IP ++ * address is found. If so, an Ethernet header is prepended and the ++ * function returns. If no ARP cache entry is found for the ++ * destination IP address, the packet in the uip_buf[] is replaced by ++ * an ARP request packet for the IP address. The IP packet is dropped ++ * and it is assumed that they higher level protocols (e.g., TCP) ++ * eventually will retransmit the dropped packet. ++ * ++ * If the destination IP address is not on the local network, the IP ++ * address of the default router is used instead. ++ * ++ * When the function returns, a packet is present in the uip_buf[] ++ * buffer, and the length of the packet is in the global variable ++ * uip_len. ++ */ ++/*-----------------------------------------------------------------------------------*/ ++void ++uip_arp_out(void) ++{ ++ struct arp_entry *tabptr; ++ /* Find the destination IP address in the ARP table and construct ++ the Ethernet header. If the destination IP addres isn't on the ++ local network, we use the default router's IP address instead. ++ ++ If not ARP table entry is found, we overwrite the original IP ++ packet with an ARP request for the IP address. */ ++ ++ /* Check if the destination address is on the local network. */ ++ if((IPBUF->destipaddr[0] & uip_arp_netmask[0]) != ++ (uip_hostaddr[0] & uip_arp_netmask[0]) || ++ (IPBUF->destipaddr[1] & uip_arp_netmask[1]) != ++ (uip_hostaddr[1] & uip_arp_netmask[1])) { ++ /* Destination address was not on the local network, so we need to ++ use the default router's IP address instead of the destination ++ address when determining the MAC address. */ ++ ipaddr[0] = uip_arp_draddr[0]; ++ ipaddr[1] = uip_arp_draddr[1]; ++ } else { ++ /* Else, we use the destination IP address. */ ++ ipaddr[0] = IPBUF->destipaddr[0]; ++ ipaddr[1] = IPBUF->destipaddr[1]; ++ } ++ ++ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { ++ tabptr = &arp_table[i]; ++ if(ipaddr[0] == tabptr->ipaddr[0] && ++ ipaddr[1] == tabptr->ipaddr[1]) ++ break; ++ } ++ ++ if(i == UIP_ARPTAB_SIZE) { ++ /* The destination address was not in our ARP table, so we ++ overwrite the IP packet with an ARP request. */ ++ ++ memset(BUF->ethhdr.dest.addr, 0xff, 6); ++ memset(BUF->dhwaddr.addr, 0x00, 6); ++ memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6); ++ memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6); ++ ++ BUF->dipaddr[0] = ipaddr[0]; ++ BUF->dipaddr[1] = ipaddr[1]; ++ BUF->sipaddr[0] = uip_hostaddr[0]; ++ BUF->sipaddr[1] = uip_hostaddr[1]; ++ BUF->opcode = HTONS(ARP_REQUEST); /* ARP request. */ ++ BUF->hwtype = HTONS(ARP_HWTYPE_ETH); ++ BUF->protocol = HTONS(UIP_ETHTYPE_IP); ++ BUF->hwlen = 6; ++ BUF->protolen = 4; ++ BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP); ++ ++ uip_appdata = &uip_buf[40 + UIP_LLH_LEN]; ++ ++ uip_len = sizeof(struct arp_hdr); ++ return; ++ } ++ ++ /* Build an ethernet header. */ ++ memcpy(IPBUF->ethhdr.dest.addr, tabptr->ethaddr.addr, 6); ++ memcpy(IPBUF->ethhdr.src.addr, uip_ethaddr.addr, 6); ++ ++ IPBUF->ethhdr.type = HTONS(UIP_ETHTYPE_IP); ++ ++ uip_len += sizeof(struct uip_eth_hdr); ++} ++/*-----------------------------------------------------------------------------------*/ ++ ++/** @} */ ++/** @} */ +--- /dev/null ++++ b/net/uip-0.9/uip_arp.h +@@ -0,0 +1,201 @@ ++/** ++ * \addtogroup uip ++ * @{ ++ */ ++ ++/** ++ * \addtogroup uiparp ++ * @{ ++ */ ++ ++/** ++ * \file ++ * Macros and definitions for the ARP module. ++ * \author Adam Dunkels ++ */ ++ ++ ++/* ++ * Copyright (c) 2001-2003, Adam Dunkels. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote ++ * products derived from this software without specific prior ++ * written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ++ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ++ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ++ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ++ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * This file is part of the uIP TCP/IP stack. ++ * ++ * $Id: uip_arp.h,v 1.3.2.2 2003/10/06 15:10:22 adam Exp $ ++ * ++ */ ++ ++#ifndef __UIP_ARP_H__ ++#define __UIP_ARP_H__ ++ ++#include "uip.h" ++ ++ ++/** ++ * Representation of a 48-bit Ethernet address. ++ */ ++struct uip_eth_addr { ++ u8_t addr[6]; ++}; ++ ++extern struct uip_eth_addr uip_ethaddr; ++ ++/** ++ * The Ethernet header. ++ */ ++struct uip_eth_hdr { ++ struct uip_eth_addr dest; ++ struct uip_eth_addr src; ++ u16_t type; ++}; ++ ++#define UIP_ETHTYPE_ARP 0x0806 ++#define UIP_ETHTYPE_IP 0x0800 ++#define UIP_ETHTYPE_IP6 0x86dd ++ ++ ++/* The uip_arp_init() function must be called before any of the other ++ ARP functions. */ ++void uip_arp_init(void); ++ ++/* The uip_arp_ipin() function should be called whenever an IP packet ++ arrives from the Ethernet. This function refreshes the ARP table or ++ inserts a new mapping if none exists. The function assumes that an ++ IP packet with an Ethernet header is present in the uip_buf buffer ++ and that the length of the packet is in the uip_len variable. */ ++void uip_arp_ipin(void); ++ ++/* The uip_arp_arpin() should be called when an ARP packet is received ++ by the Ethernet driver. This function also assumes that the ++ Ethernet frame is present in the uip_buf buffer. When the ++ uip_arp_arpin() function returns, the contents of the uip_buf ++ buffer should be sent out on the Ethernet if the uip_len variable ++ is > 0. */ ++void uip_arp_arpin(void); ++ ++/* The uip_arp_out() function should be called when an IP packet ++ should be sent out on the Ethernet. This function creates an ++ Ethernet header before the IP header in the uip_buf buffer. The ++ Ethernet header will have the correct Ethernet MAC destination ++ address filled in if an ARP table entry for the destination IP ++ address (or the IP address of the default router) is present. If no ++ such table entry is found, the IP packet is overwritten with an ARP ++ request and we rely on TCP to retransmit the packet that was ++ overwritten. In any case, the uip_len variable holds the length of ++ the Ethernet frame that should be transmitted. */ ++void uip_arp_out(void); ++ ++/* The uip_arp_timer() function should be called every ten seconds. It ++ is responsible for flushing old entries in the ARP table. */ ++void uip_arp_timer(void); ++ ++/** @} */ ++ ++/** ++ * \addtogroup uipconffunc ++ * @{ ++ */ ++ ++/** ++ * Set the default router's IP address. ++ * ++ * \param addr A pointer to a 4-byte array containing the IP address ++ * of the default router. ++ * ++ * \hideinitializer ++ */ ++#define uip_setdraddr(addr) do { uip_arp_draddr[0] = addr[0]; \ ++ uip_arp_draddr[1] = addr[1]; } while(0) ++ ++/** ++ * Set the netmask. ++ * ++ * \param addr A pointer to a 4-byte array containing the IP address ++ * of the netmask. ++ * ++ * \hideinitializer ++ */ ++#define uip_setnetmask(addr) do { uip_arp_netmask[0] = addr[0]; \ ++ uip_arp_netmask[1] = addr[1]; } while(0) ++ ++ ++/** ++ * Get the default router's IP address. ++ * ++ * \param addr A pointer to a 4-byte array that will be filled in with ++ * the IP address of the default router. ++ * ++ * \hideinitializer ++ */ ++#define uip_getdraddr(addr) do { addr[0] = uip_arp_draddr[0]; \ ++ addr[1] = uip_arp_draddr[1]; } while(0) ++ ++/** ++ * Get the netmask. ++ * ++ * \param addr A pointer to a 4-byte array that will be filled in with ++ * the value of the netmask. ++ * ++ * \hideinitializer ++ */ ++#define uip_getnetmask(addr) do { addr[0] = uip_arp_netmask[0]; \ ++ addr[1] = uip_arp_netmask[1]; } while(0) ++ ++ ++/** ++ * Specifiy the Ethernet MAC address. ++ * ++ * The ARP code needs to know the MAC address of the Ethernet card in ++ * order to be able to respond to ARP queries and to generate working ++ * Ethernet headers. ++ * ++ * \note This macro only specifies the Ethernet MAC address to the ARP ++ * code. It cannot be used to change the MAC address of the Ethernet ++ * card. ++ * ++ * \param eaddr A pointer to a struct uip_eth_addr containing the ++ * Ethernet MAC address of the Ethernet card. ++ * ++ * \hideinitializer ++ */ ++#define uip_setethaddr(eaddr) do {uip_ethaddr.addr[0] = eaddr.addr[0]; \ ++ uip_ethaddr.addr[1] = eaddr.addr[1];\ ++ uip_ethaddr.addr[2] = eaddr.addr[2];\ ++ uip_ethaddr.addr[3] = eaddr.addr[3];\ ++ uip_ethaddr.addr[4] = eaddr.addr[4];\ ++ uip_ethaddr.addr[5] = eaddr.addr[5];} while(0) ++ ++/** @} */ ++ ++/** ++ * \internal Internal variables that are set using the macros ++ * uip_setdraddr and uip_setnetmask. ++ */ ++extern u16_t uip_arp_draddr[2], uip_arp_netmask[2]; ++#endif /* __UIP_ARP_H__ */ ++ ++ +--- /dev/null +++ b/net/uip-0.9/uip.c @@ -0,0 +1,1503 @@ +/** @@ -7880,915 +8789,6 @@ +/** @} */ + --- /dev/null -+++ b/net/uip-0.9/uip_arch.c -@@ -0,0 +1,145 @@ -+/* -+ * Copyright (c) 2001, Adam Dunkels. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. The name of the author may not be used to endorse or promote -+ * products derived from this software without specific prior -+ * written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ * -+ * This file is part of the uIP TCP/IP stack. -+ * -+ * $Id: uip_arch.c,v 1.2.2.1 2003/10/04 22:54:17 adam Exp $ -+ * -+ */ -+ -+ -+#include "uip.h" -+#include "uip_arch.h" -+ -+#define BUF ((uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) -+#define IP_PROTO_TCP 6 -+ -+/*-----------------------------------------------------------------------------------*/ -+void -+uip_add32(u8_t *op32, u16_t op16) -+{ -+ -+ uip_acc32[3] = op32[3] + (op16 & 0xff); -+ uip_acc32[2] = op32[2] + (op16 >> 8); -+ uip_acc32[1] = op32[1]; -+ uip_acc32[0] = op32[0]; -+ -+ if(uip_acc32[2] < (op16 >> 8)) { -+ ++uip_acc32[1]; -+ if(uip_acc32[1] == 0) { -+ ++uip_acc32[0]; -+ } -+ } -+ -+ -+ if(uip_acc32[3] < (op16 & 0xff)) { -+ ++uip_acc32[2]; -+ if(uip_acc32[2] == 0) { -+ ++uip_acc32[1]; -+ if(uip_acc32[1] == 0) { -+ ++uip_acc32[0]; -+ } -+ } -+ } -+} -+/*-----------------------------------------------------------------------------------*/ -+u16_t -+uip_chksum(u16_t *sdata, u16_t len) -+{ -+ u16_t acc; -+ -+ for(acc = 0; len > 1; len -= 2) { -+ acc += *sdata; -+ if(acc < *sdata) { -+ /* Overflow, so we add the carry to acc (i.e., increase by -+ one). */ -+ ++acc; -+ } -+ ++sdata; -+ } -+ -+ /* add up any odd byte */ -+ if(len == 1) { -+ acc += htons(((u16_t)(*(u8_t *)sdata)) << 8); -+ if(acc < htons(((u16_t)(*(u8_t *)sdata)) << 8)) { -+ ++acc; -+ } -+ } -+ -+ return acc; -+} -+/*-----------------------------------------------------------------------------------*/ -+u16_t -+uip_ipchksum(void) -+{ -+ return uip_chksum((u16_t *)&uip_buf[UIP_LLH_LEN], 20); -+} -+/*-----------------------------------------------------------------------------------*/ -+u16_t -+uip_tcpchksum(void) -+{ -+ u16_t hsum, sum; -+ -+ -+ /* Compute the checksum of the TCP header. */ -+ hsum = uip_chksum((u16_t *)&uip_buf[20 + UIP_LLH_LEN], 20); -+ -+ /* Compute the checksum of the data in the TCP packet and add it to -+ the TCP header checksum. */ -+ sum = uip_chksum((u16_t *)uip_appdata, -+ (u16_t)(((((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - 40))); -+ -+ if((sum += hsum) < hsum) { -+ ++sum; -+ } -+ -+ if((sum += BUF->srcipaddr[0]) < BUF->srcipaddr[0]) { -+ ++sum; -+ } -+ if((sum += BUF->srcipaddr[1]) < BUF->srcipaddr[1]) { -+ ++sum; -+ } -+ if((sum += BUF->destipaddr[0]) < BUF->destipaddr[0]) { -+ ++sum; -+ } -+ if((sum += BUF->destipaddr[1]) < BUF->destipaddr[1]) { -+ ++sum; -+ } -+ if((sum += (u16_t)htons((u16_t)IP_PROTO_TCP)) < (u16_t)htons((u16_t)IP_PROTO_TCP)) { -+ ++sum; -+ } -+ -+ hsum = (u16_t)htons((((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - 20); -+ -+ if((sum += hsum) < hsum) { -+ ++sum; -+ } -+ -+ return sum; -+} -+/*-----------------------------------------------------------------------------------*/ ---- /dev/null -+++ b/net/uip-0.9/uip_arch.h -@@ -0,0 +1,130 @@ -+/** -+ * \defgroup uiparch Architecture specific uIP functions -+ * @{ -+ * -+ * The functions in the architecture specific module implement the IP -+ * check sum and 32-bit additions. -+ * -+ * The IP checksum calculation is the most computationally expensive -+ * operation in the TCP/IP stack and it therefore pays off to -+ * implement this in efficient assembler. The purpose of the uip-arch -+ * module is to let the checksum functions to be implemented in -+ * architecture specific assembler. -+ * -+ */ -+ -+/** -+ * \file -+ * Declarations of architecture specific functions. -+ * \author Adam Dunkels -+ */ -+ -+/* -+ * Copyright (c) 2001, Adam Dunkels. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. The name of the author may not be used to endorse or promote -+ * products derived from this software without specific prior -+ * written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ * -+ * This file is part of the uIP TCP/IP stack. -+ * -+ * $Id: uip_arch.h,v 1.1.2.2 2003/10/06 15:10:22 adam Exp $ -+ * -+ */ -+ -+#ifndef __UIP_ARCH_H__ -+#define __UIP_ARCH_H__ -+ -+#include "uip.h" -+ -+/** -+ * Carry out a 32-bit addition. -+ * -+ * Because not all architectures for which uIP is intended has native -+ * 32-bit arithmetic, uIP uses an external C function for doing the -+ * required 32-bit additions in the TCP protocol processing. This -+ * function should add the two arguments and place the result in the -+ * global variable uip_acc32. -+ * -+ * \note The 32-bit integer pointed to by the op32 parameter and the -+ * result in the uip_acc32 variable are in network byte order (big -+ * endian). -+ * -+ * \param op32 A pointer to a 4-byte array representing a 32-bit -+ * integer in network byte order (big endian). -+ * -+ * \param op16 A 16-bit integer in host byte order. -+ */ -+void uip_add32(u8_t *op32, u16_t op16); -+ -+/** -+ * Calculate the Internet checksum over a buffer. -+ * -+ * The Internet checksum is the one's complement of the one's -+ * complement sum of all 16-bit words in the buffer. -+ * -+ * See RFC1071. -+ * -+ * \note This function is not called in the current version of uIP, -+ * but future versions might make use of it. -+ * -+ * \param buf A pointer to the buffer over which the checksum is to be -+ * computed. -+ * -+ * \param len The length of the buffer over which the checksum is to -+ * be computed. -+ * -+ * \return The Internet checksum of the buffer. -+ */ -+u16_t uip_chksum(u16_t *buf, u16_t len); -+ -+/** -+ * Calculate the IP header checksum of the packet header in uip_buf. -+ * -+ * The IP header checksum is the Internet checksum of the 20 bytes of -+ * the IP header. -+ * -+ * \return The IP header checksum of the IP header in the uip_buf -+ * buffer. -+ */ -+u16_t uip_ipchksum(void); -+ -+/** -+ * Calculate the TCP checksum of the packet in uip_buf and uip_appdata. -+ * -+ * The TCP checksum is the Internet checksum of data contents of the -+ * TCP segment, and a pseudo-header as defined in RFC793. -+ * -+ * \note The uip_appdata pointer that points to the packet data may -+ * point anywhere in memory, so it is not possible to simply calculate -+ * the Internet checksum of the contents of the uip_buf buffer. -+ * -+ * \return The TCP checksum of the TCP segment in uip_buf and pointed -+ * to by uip_appdata. -+ */ -+u16_t uip_tcpchksum(void); -+ -+/** @} */ -+ -+#endif /* __UIP_ARCH_H__ */ ---- /dev/null -+++ b/net/uip-0.9/uip_arp.c -@@ -0,0 +1,421 @@ -+/** -+ * \addtogroup uip -+ * @{ -+ */ -+ -+/** -+ * \defgroup uiparp uIP Address Resolution Protocol -+ * @{ -+ * -+ * The Address Resolution Protocol ARP is used for mapping between IP -+ * addresses and link level addresses such as the Ethernet MAC -+ * addresses. ARP uses broadcast queries to ask for the link level -+ * address of a known IP address and the host which is configured with -+ * the IP address for which the query was meant, will respond with its -+ * link level address. -+ * -+ * \note This ARP implementation only supports Ethernet. -+ */ -+ -+/** -+ * \file -+ * Implementation of the ARP Address Resolution Protocol. -+ * \author Adam Dunkels -+ * -+ */ -+ -+/* -+ * Copyright (c) 2001-2003, Adam Dunkels. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. The name of the author may not be used to endorse or promote -+ * products derived from this software without specific prior -+ * written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ * -+ * This file is part of the uIP TCP/IP stack. -+ * -+ * $Id: uip_arp.c,v 1.7.2.3 2003/10/06 22:42:30 adam Exp $ -+ * -+ */ -+ -+ -+#include "uip_arp.h" -+ -+struct arp_hdr { -+ struct uip_eth_hdr ethhdr; -+ u16_t hwtype; -+ u16_t protocol; -+ u8_t hwlen; -+ u8_t protolen; -+ u16_t opcode; -+ struct uip_eth_addr shwaddr; -+ u16_t sipaddr[2]; -+ struct uip_eth_addr dhwaddr; -+ u16_t dipaddr[2]; -+}; -+ -+struct ethip_hdr { -+ struct uip_eth_hdr ethhdr; -+ /* IP header. */ -+ u8_t vhl, -+ tos, -+ len[2], -+ ipid[2], -+ ipoffset[2], -+ ttl, -+ proto; -+ u16_t ipchksum; -+ u16_t srcipaddr[2], -+ destipaddr[2]; -+}; -+ -+#define ARP_REQUEST 1 -+#define ARP_REPLY 2 -+ -+#define ARP_HWTYPE_ETH 1 -+ -+struct arp_entry { -+ u16_t ipaddr[2]; -+ struct uip_eth_addr ethaddr; -+ u8_t time; -+}; -+ -+struct uip_eth_addr uip_ethaddr = {{UIP_ETHADDR0, -+ UIP_ETHADDR1, -+ UIP_ETHADDR2, -+ UIP_ETHADDR3, -+ UIP_ETHADDR4, -+ UIP_ETHADDR5}}; -+ -+static struct arp_entry arp_table[UIP_ARPTAB_SIZE]; -+static u16_t ipaddr[2]; -+static u8_t i, c; -+ -+static u8_t arptime; -+static u8_t tmpage; -+ -+#define BUF ((struct arp_hdr *)&uip_buf[0]) -+#define IPBUF ((struct ethip_hdr *)&uip_buf[0]) -+/*-----------------------------------------------------------------------------------*/ -+/** -+ * Initialize the ARP module. -+ * -+ */ -+/*-----------------------------------------------------------------------------------*/ -+void -+uip_arp_init(void) -+{ -+ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { -+ memset(arp_table[i].ipaddr, 0, 4); -+ } -+} -+/*-----------------------------------------------------------------------------------*/ -+/** -+ * Periodic ARP processing function. -+ * -+ * This function performs periodic timer processing in the ARP module -+ * and should be called at regular intervals. The recommended interval -+ * is 10 seconds between the calls. -+ * -+ */ -+/*-----------------------------------------------------------------------------------*/ -+void -+uip_arp_timer(void) -+{ -+ struct arp_entry *tabptr; -+ -+ ++arptime; -+ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { -+ tabptr = &arp_table[i]; -+ if((tabptr->ipaddr[0] | tabptr->ipaddr[1]) != 0 && -+ arptime - tabptr->time >= UIP_ARP_MAXAGE) { -+ memset(tabptr->ipaddr, 0, 4); -+ } -+ } -+ -+} -+/*-----------------------------------------------------------------------------------*/ -+static void -+uip_arp_update(u16_t *ipaddr, struct uip_eth_addr *ethaddr) -+{ -+ register struct arp_entry *tabptr; -+ /* Walk through the ARP mapping table and try to find an entry to -+ update. If none is found, the IP -> MAC address mapping is -+ inserted in the ARP table. */ -+ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { -+ -+ tabptr = &arp_table[i]; -+ /* Only check those entries that are actually in use. */ -+ if(tabptr->ipaddr[0] != 0 && -+ tabptr->ipaddr[1] != 0) { -+ -+ /* Check if the source IP address of the incoming packet matches -+ the IP address in this ARP table entry. */ -+ if(ipaddr[0] == tabptr->ipaddr[0] && -+ ipaddr[1] == tabptr->ipaddr[1]) { -+ -+ /* An old entry found, update this and return. */ -+ memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6); -+ tabptr->time = arptime; -+ -+ return; -+ } -+ } -+ } -+ -+ /* If we get here, no existing ARP table entry was found, so we -+ create one. */ -+ -+ /* First, we try to find an unused entry in the ARP table. */ -+ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { -+ tabptr = &arp_table[i]; -+ if(tabptr->ipaddr[0] == 0 && -+ tabptr->ipaddr[1] == 0) { -+ break; -+ } -+ } -+ -+ /* If no unused entry is found, we try to find the oldest entry and -+ throw it away. */ -+ if(i == UIP_ARPTAB_SIZE) { -+ tmpage = 0; -+ c = 0; -+ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { -+ tabptr = &arp_table[i]; -+ if(arptime - tabptr->time > tmpage) { -+ tmpage = arptime - tabptr->time; -+ c = i; -+ } -+ } -+ i = c; -+ } -+ -+ /* Now, i is the ARP table entry which we will fill with the new -+ information. */ -+ memcpy(tabptr->ipaddr, ipaddr, 4); -+ memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6); -+ tabptr->time = arptime; -+} -+/*-----------------------------------------------------------------------------------*/ -+/** -+ * ARP processing for incoming IP packets -+ * -+ * This function should be called by the device driver when an IP -+ * packet has been received. The function will check if the address is -+ * in the ARP cache, and if so the ARP cache entry will be -+ * refreshed. If no ARP cache entry was found, a new one is created. -+ * -+ * This function expects an IP packet with a prepended Ethernet header -+ * in the uip_buf[] buffer, and the length of the packet in the global -+ * variable uip_len. -+ */ -+/*-----------------------------------------------------------------------------------*/ -+void -+uip_arp_ipin(void) -+{ -+ uip_len -= sizeof(struct uip_eth_hdr); -+ -+ /* Only insert/update an entry if the source IP address of the -+ incoming IP packet comes from a host on the local network. */ -+ if((IPBUF->srcipaddr[0] & uip_arp_netmask[0]) != -+ (uip_hostaddr[0] & uip_arp_netmask[0])) { -+ return; -+ } -+ if((IPBUF->srcipaddr[1] & uip_arp_netmask[1]) != -+ (uip_hostaddr[1] & uip_arp_netmask[1])) { -+ return; -+ } -+ uip_arp_update(IPBUF->srcipaddr, &(IPBUF->ethhdr.src)); -+ -+ return; -+} -+/*-----------------------------------------------------------------------------------*/ -+/** -+ * ARP processing for incoming ARP packets. -+ * -+ * This function should be called by the device driver when an ARP -+ * packet has been received. The function will act differently -+ * depending on the ARP packet type: if it is a reply for a request -+ * that we previously sent out, the ARP cache will be filled in with -+ * the values from the ARP reply. If the incoming ARP packet is an ARP -+ * request for our IP address, an ARP reply packet is created and put -+ * into the uip_buf[] buffer. -+ * -+ * When the function returns, the value of the global variable uip_len -+ * indicates whether the device driver should send out a packet or -+ * not. If uip_len is zero, no packet should be sent. If uip_len is -+ * non-zero, it contains the length of the outbound packet that is -+ * present in the uip_buf[] buffer. -+ * -+ * This function expects an ARP packet with a prepended Ethernet -+ * header in the uip_buf[] buffer, and the length of the packet in the -+ * global variable uip_len. -+ */ -+/*-----------------------------------------------------------------------------------*/ -+void -+uip_arp_arpin(void) -+{ -+ -+ if(uip_len < sizeof(struct arp_hdr)) { -+ uip_len = 0; -+ return; -+ } -+ -+ uip_len = 0; -+ -+ switch(BUF->opcode) { -+ case HTONS(ARP_REQUEST): -+ /* ARP request. If it asked for our address, we send out a -+ reply. */ -+ if(BUF->dipaddr[0] == uip_hostaddr[0] && -+ BUF->dipaddr[1] == uip_hostaddr[1]) { -+ /* The reply opcode is 2. */ -+ BUF->opcode = HTONS(2); -+ -+ memcpy(BUF->dhwaddr.addr, BUF->shwaddr.addr, 6); -+ memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6); -+ memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6); -+ memcpy(BUF->ethhdr.dest.addr, BUF->dhwaddr.addr, 6); -+ -+ BUF->dipaddr[0] = BUF->sipaddr[0]; -+ BUF->dipaddr[1] = BUF->sipaddr[1]; -+ BUF->sipaddr[0] = uip_hostaddr[0]; -+ BUF->sipaddr[1] = uip_hostaddr[1]; -+ -+ BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP); -+ uip_len = sizeof(struct arp_hdr); -+ } -+ break; -+ case HTONS(ARP_REPLY): -+ /* ARP reply. We insert or update the ARP table if it was meant -+ for us. */ -+ if(BUF->dipaddr[0] == uip_hostaddr[0] && -+ BUF->dipaddr[1] == uip_hostaddr[1]) { -+ -+ uip_arp_update(BUF->sipaddr, &BUF->shwaddr); -+ } -+ break; -+ } -+ -+ return; -+} -+/*-----------------------------------------------------------------------------------*/ -+/** -+ * Prepend Ethernet header to an outbound IP packet and see if we need -+ * to send out an ARP request. -+ * -+ * This function should be called before sending out an IP packet. The -+ * function checks the destination IP address of the IP packet to see -+ * what Ethernet MAC address that should be used as a destination MAC -+ * address on the Ethernet. -+ * -+ * If the destination IP address is in the local network (determined -+ * by logical ANDing of netmask and our IP address), the function -+ * checks the ARP cache to see if an entry for the destination IP -+ * address is found. If so, an Ethernet header is prepended and the -+ * function returns. If no ARP cache entry is found for the -+ * destination IP address, the packet in the uip_buf[] is replaced by -+ * an ARP request packet for the IP address. The IP packet is dropped -+ * and it is assumed that they higher level protocols (e.g., TCP) -+ * eventually will retransmit the dropped packet. -+ * -+ * If the destination IP address is not on the local network, the IP -+ * address of the default router is used instead. -+ * -+ * When the function returns, a packet is present in the uip_buf[] -+ * buffer, and the length of the packet is in the global variable -+ * uip_len. -+ */ -+/*-----------------------------------------------------------------------------------*/ -+void -+uip_arp_out(void) -+{ -+ struct arp_entry *tabptr; -+ /* Find the destination IP address in the ARP table and construct -+ the Ethernet header. If the destination IP addres isn't on the -+ local network, we use the default router's IP address instead. -+ -+ If not ARP table entry is found, we overwrite the original IP -+ packet with an ARP request for the IP address. */ -+ -+ /* Check if the destination address is on the local network. */ -+ if((IPBUF->destipaddr[0] & uip_arp_netmask[0]) != -+ (uip_hostaddr[0] & uip_arp_netmask[0]) || -+ (IPBUF->destipaddr[1] & uip_arp_netmask[1]) != -+ (uip_hostaddr[1] & uip_arp_netmask[1])) { -+ /* Destination address was not on the local network, so we need to -+ use the default router's IP address instead of the destination -+ address when determining the MAC address. */ -+ ipaddr[0] = uip_arp_draddr[0]; -+ ipaddr[1] = uip_arp_draddr[1]; -+ } else { -+ /* Else, we use the destination IP address. */ -+ ipaddr[0] = IPBUF->destipaddr[0]; -+ ipaddr[1] = IPBUF->destipaddr[1]; -+ } -+ -+ for(i = 0; i < UIP_ARPTAB_SIZE; ++i) { -+ tabptr = &arp_table[i]; -+ if(ipaddr[0] == tabptr->ipaddr[0] && -+ ipaddr[1] == tabptr->ipaddr[1]) -+ break; -+ } -+ -+ if(i == UIP_ARPTAB_SIZE) { -+ /* The destination address was not in our ARP table, so we -+ overwrite the IP packet with an ARP request. */ -+ -+ memset(BUF->ethhdr.dest.addr, 0xff, 6); -+ memset(BUF->dhwaddr.addr, 0x00, 6); -+ memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6); -+ memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6); -+ -+ BUF->dipaddr[0] = ipaddr[0]; -+ BUF->dipaddr[1] = ipaddr[1]; -+ BUF->sipaddr[0] = uip_hostaddr[0]; -+ BUF->sipaddr[1] = uip_hostaddr[1]; -+ BUF->opcode = HTONS(ARP_REQUEST); /* ARP request. */ -+ BUF->hwtype = HTONS(ARP_HWTYPE_ETH); -+ BUF->protocol = HTONS(UIP_ETHTYPE_IP); -+ BUF->hwlen = 6; -+ BUF->protolen = 4; -+ BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP); -+ -+ uip_appdata = &uip_buf[40 + UIP_LLH_LEN]; -+ -+ uip_len = sizeof(struct arp_hdr); -+ return; -+ } -+ -+ /* Build an ethernet header. */ -+ memcpy(IPBUF->ethhdr.dest.addr, tabptr->ethaddr.addr, 6); -+ memcpy(IPBUF->ethhdr.src.addr, uip_ethaddr.addr, 6); -+ -+ IPBUF->ethhdr.type = HTONS(UIP_ETHTYPE_IP); -+ -+ uip_len += sizeof(struct uip_eth_hdr); -+} -+/*-----------------------------------------------------------------------------------*/ -+ -+/** @} */ -+/** @} */ ---- /dev/null -+++ b/net/uip-0.9/uip_arp.h -@@ -0,0 +1,201 @@ -+/** -+ * \addtogroup uip -+ * @{ -+ */ -+ -+/** -+ * \addtogroup uiparp -+ * @{ -+ */ -+ -+/** -+ * \file -+ * Macros and definitions for the ARP module. -+ * \author Adam Dunkels -+ */ -+ -+ -+/* -+ * Copyright (c) 2001-2003, Adam Dunkels. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. The name of the author may not be used to endorse or promote -+ * products derived from this software without specific prior -+ * written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ * -+ * This file is part of the uIP TCP/IP stack. -+ * -+ * $Id: uip_arp.h,v 1.3.2.2 2003/10/06 15:10:22 adam Exp $ -+ * -+ */ -+ -+#ifndef __UIP_ARP_H__ -+#define __UIP_ARP_H__ -+ -+#include "uip.h" -+ -+ -+/** -+ * Representation of a 48-bit Ethernet address. -+ */ -+struct uip_eth_addr { -+ u8_t addr[6]; -+}; -+ -+extern struct uip_eth_addr uip_ethaddr; -+ -+/** -+ * The Ethernet header. -+ */ -+struct uip_eth_hdr { -+ struct uip_eth_addr dest; -+ struct uip_eth_addr src; -+ u16_t type; -+}; -+ -+#define UIP_ETHTYPE_ARP 0x0806 -+#define UIP_ETHTYPE_IP 0x0800 -+#define UIP_ETHTYPE_IP6 0x86dd -+ -+ -+/* The uip_arp_init() function must be called before any of the other -+ ARP functions. */ -+void uip_arp_init(void); -+ -+/* The uip_arp_ipin() function should be called whenever an IP packet -+ arrives from the Ethernet. This function refreshes the ARP table or -+ inserts a new mapping if none exists. The function assumes that an -+ IP packet with an Ethernet header is present in the uip_buf buffer -+ and that the length of the packet is in the uip_len variable. */ -+void uip_arp_ipin(void); -+ -+/* The uip_arp_arpin() should be called when an ARP packet is received -+ by the Ethernet driver. This function also assumes that the -+ Ethernet frame is present in the uip_buf buffer. When the -+ uip_arp_arpin() function returns, the contents of the uip_buf -+ buffer should be sent out on the Ethernet if the uip_len variable -+ is > 0. */ -+void uip_arp_arpin(void); -+ -+/* The uip_arp_out() function should be called when an IP packet -+ should be sent out on the Ethernet. This function creates an -+ Ethernet header before the IP header in the uip_buf buffer. The -+ Ethernet header will have the correct Ethernet MAC destination -+ address filled in if an ARP table entry for the destination IP -+ address (or the IP address of the default router) is present. If no -+ such table entry is found, the IP packet is overwritten with an ARP -+ request and we rely on TCP to retransmit the packet that was -+ overwritten. In any case, the uip_len variable holds the length of -+ the Ethernet frame that should be transmitted. */ -+void uip_arp_out(void); -+ -+/* The uip_arp_timer() function should be called every ten seconds. It -+ is responsible for flushing old entries in the ARP table. */ -+void uip_arp_timer(void); -+ -+/** @} */ -+ -+/** -+ * \addtogroup uipconffunc -+ * @{ -+ */ -+ -+/** -+ * Set the default router's IP address. -+ * -+ * \param addr A pointer to a 4-byte array containing the IP address -+ * of the default router. -+ * -+ * \hideinitializer -+ */ -+#define uip_setdraddr(addr) do { uip_arp_draddr[0] = addr[0]; \ -+ uip_arp_draddr[1] = addr[1]; } while(0) -+ -+/** -+ * Set the netmask. -+ * -+ * \param addr A pointer to a 4-byte array containing the IP address -+ * of the netmask. -+ * -+ * \hideinitializer -+ */ -+#define uip_setnetmask(addr) do { uip_arp_netmask[0] = addr[0]; \ -+ uip_arp_netmask[1] = addr[1]; } while(0) -+ -+ -+/** -+ * Get the default router's IP address. -+ * -+ * \param addr A pointer to a 4-byte array that will be filled in with -+ * the IP address of the default router. -+ * -+ * \hideinitializer -+ */ -+#define uip_getdraddr(addr) do { addr[0] = uip_arp_draddr[0]; \ -+ addr[1] = uip_arp_draddr[1]; } while(0) -+ -+/** -+ * Get the netmask. -+ * -+ * \param addr A pointer to a 4-byte array that will be filled in with -+ * the value of the netmask. -+ * -+ * \hideinitializer -+ */ -+#define uip_getnetmask(addr) do { addr[0] = uip_arp_netmask[0]; \ -+ addr[1] = uip_arp_netmask[1]; } while(0) -+ -+ -+/** -+ * Specifiy the Ethernet MAC address. -+ * -+ * The ARP code needs to know the MAC address of the Ethernet card in -+ * order to be able to respond to ARP queries and to generate working -+ * Ethernet headers. -+ * -+ * \note This macro only specifies the Ethernet MAC address to the ARP -+ * code. It cannot be used to change the MAC address of the Ethernet -+ * card. -+ * -+ * \param eaddr A pointer to a struct uip_eth_addr containing the -+ * Ethernet MAC address of the Ethernet card. -+ * -+ * \hideinitializer -+ */ -+#define uip_setethaddr(eaddr) do {uip_ethaddr.addr[0] = eaddr.addr[0]; \ -+ uip_ethaddr.addr[1] = eaddr.addr[1];\ -+ uip_ethaddr.addr[2] = eaddr.addr[2];\ -+ uip_ethaddr.addr[3] = eaddr.addr[3];\ -+ uip_ethaddr.addr[4] = eaddr.addr[4];\ -+ uip_ethaddr.addr[5] = eaddr.addr[5];} while(0) -+ -+/** @} */ -+ -+/** -+ * \internal Internal variables that are set using the macros -+ * uip_setdraddr and uip_setnetmask. -+ */ -+extern u16_t uip_arp_draddr[2], uip_arp_netmask[2]; -+#endif /* __UIP_ARP_H__ */ -+ -+ ---- /dev/null +++ b/net/uip-0.9/uipopt.h @@ -0,0 +1,557 @@ +/**