move package/linux into target/linux, use wbx' new kernel code. support building images with more than one kernel, split kernel module parts off of packages that use their own kernel modules (fuse, shfs, openswan). some cleanup in the image building process in target/. image builder is disabled for now, needs some fixing.

git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@1085 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
Felix Fietkau
2005-05-28 09:17:29 +00:00
parent fdd5681c06
commit 1c4a2a55f7
234 changed files with 1012 additions and 121969 deletions

View File

@@ -125,11 +125,5 @@ source "package/sdk/Config.in"
endmenu
menu "Kernel Configuration"
source "package/linux/Config.in"
endmenu
source "package/Sysconf.in"

View File

@@ -114,7 +114,7 @@ SDK_DEFAULT_PACKAGES:=busybox dnsmasq iptables wireless-tools dropbear bridge ip
SDK_DEFAULT_COMPILE:=$(patsubst %,%-compile,$(SDK_DEFAULT_PACKAGES))
all: compile install
clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m)) linux-clean
clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
compile: $(patsubst %,%-compile,$(package-y) $(package-m))
install: $(patsubst %,%-install,$(package-y))
@@ -200,7 +200,6 @@ ulogd-compile: postgresql-compile
endif
sdk-compile: $(DEV_LIBS_COMPILE) $(SDK_DEFAULT_COMPILE) openwrt-install
$(patsubst %,%-prepare,$(package-y) $(package-m) $(package-)): linux-install
%-prepare:
@[ -f $(STAMP_DIR)/.$@ ] || $(MAKE) -C $(patsubst %-prepare,%,$@) prepare

View File

@@ -1,39 +1,14 @@
config BR2_PACKAGE_FUSE
bool
default n
depends BR2_PACKAGE_KMOD_FUSE
depends BR2_PACKAGE_LIBFUSE
config BR2_PACKAGE_KMOD_FUSE
select BR2_PACKAGE_FUSE
prompt "kmod-fuse - FUSE kernel module"
tristate
default m if CONFIG_DEVEL
select BR2_PACKAGE_FUSE
help
With FUSE it is possible to implement a fully functional
filesystem in a userspace program.
Features include:
* Simple library API
* Simple installation (no need to patch or recompile the kernel)
* Secure implementation
* Userspace - kernel interface is very efficient
* Usable by non privileged users
* Runs on Linux kernels 2.4.X and 2.6.X
* Has proven very stable over time
http://fuse.sourceforge.net/
This package contains the fuse.o kernel module.
config BR2_PACKAGE_LIBFUSE
prompt "libfuse - FUSE library"
tristate
default m if CONFIG_DEVEL
depends BR2_PACKAGE_KMOD_FUSE
select BR2_PACKAGE_KMOD_FUSE
select BR2_PACKAGE_LIBPTHREAD
help
With FUSE it is possible to implement a fully functional

View File

@@ -16,7 +16,6 @@ PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
include $(TOPDIR)/package/rules.mk
$(eval $(call PKG_template,KMOD_FUSE,kmod-fuse,$(LINUX_VERSION)+$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,LIBFUSE,libfuse,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,FUSE_UTILS,fuse-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
@@ -69,12 +68,6 @@ $(PKG_BUILD_DIR)/.built:
all install
touch $@
$(IPKG_KMOD_FUSE):
mkdir -p $(IDIR_KMOD_FUSE)/lib/modules/$(LINUX_VERSION)
cp -fpR $(PKG_INSTALL_DIR)/lib/modules/$(LINUX_VERSION)/kernel/fs/fuse/fuse.o \
$(IDIR_KMOD_FUSE)/lib/modules/$(LINUX_VERSION)/
$(IPKG_BUILD) $(IDIR_KMOD_FUSE) $(PACKAGE_DIR)
$(IPKG_LIBFUSE):
mkdir -p $(IDIR_LIBFUSE)/usr/lib
cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libfuse.so.* $(IDIR_LIBFUSE)/usr/lib/

View File

@@ -1,8 +0,0 @@
Package: kmod-fuse
Priority: optional
Section: kernel
Version: [TBDL]
Architecture: [TBDL]
Maintainer: Nico <nthill@free.fr>
Source: http://nthill.free.fr/openwrt/sources/fuse2/
Description: Filesystem in Userspace (kernel module)

View File

@@ -1,212 +0,0 @@
config BR2_PACKAGE_KMOD_DIAG
tristate "Router LED/Button Driver"
default y
help
Driver for the LEDs on Wireless Routers (diag)
config BR2_PACKAGE_KMOD_BRCM_WL
tristate "Broadcom Wireless Network Driver"
default y
help
Proprietary driver for Broadcom Wireless chipsets
config BR2_PACKAGE_KMOD_BRCM_ET
tristate "Broadcom Ethernet Driver"
default y
help
Proprietary driver for Broadcom Ethernet chipsets
config BR2_PACKAGE_KMOD_B44
tristate "Broadcom 44XX, 47XX ethernet driver"
default m
help
Free driver for Broadcom Ethernet chipsets (without switch support)
config BR2_PACKAGE_KMOD_ARPT
tristate "ARP firewalling support"
default m
help
Kernel modules for ARP firewalling
config BR2_PACKAGE_KMOD_EBT
tristate "Ethernet Bridge firewalling support"
default m
help
Kernel modules for bridge firewalling
config BR2_PACKAGE_KMOD_IPTABLES_V4
tristate "Basic set of kernel modules for iptables"
default y
help
Kernel modules for IPv4 firewalling
config BR2_PACKAGE_KMOD_IPTABLES_V4_EXTRA
tristate "Extra modules for iptables"
default m
help
Extra kernel modules for IPv4 firewalling
config BR2_PACKAGE_KMOD_IPV6
tristate "IPv6 support"
default m
help
Kernel modules for IPv6 protocol support
config BR2_PACKAGE_KMOD_IPTABLES_V6
tristate "Kernel modules for ip6tables"
default m
depends BR2_PACKAGE_KMOD_IPV6
help
IPv6 firewalling support
config BR2_PACKAGE_KMOD_NFS
tristate "NFS support"
default m
help
Kernel modules for NFS support
Includes lockd, nfs and sunrpc
config BR2_PACKAGE_KMOD_CIFS
tristate "CIFS support"
default m
help
Kernel modules for CIFS support
config BR2_PACKAGE_KMOD_USB
tristate "USB support"
default m
config BR2_PACKAGE_KMOD_USB_CONTROLLER
tristate
depends on BR2_PACKAGE_KMOD_USB_UHCI || BR2_PACKAGE_KMOD_USB_OHCI
default n
config BR2_PACKAGE_KMOD_USB_UHCI
tristate "Support for UHCI controllers"
default m
depends BR2_PACKAGE_KMOD_USB
select BR2_PACKAGE_KMOD_USB_CONTROLLER
config BR2_PACKAGE_KMOD_USB_OHCI
tristate "Support for OHCI controllers"
default m
depends BR2_PACKAGE_KMOD_USB
select BR2_PACKAGE_KMOD_USB_CONTROLLER
config BR2_PACKAGE_KMOD_USB2
tristate "Support for USB 2.0 controllers"
default m
depends BR2_PACKAGE_KMOD_USB_CONTROLLER
config BR2_PACKAGE_KMOD_USB_STORAGE
tristate "Support for USB storage devices"
default m
depends BR2_PACKAGE_KMOD_USB_CONTROLLER
config BR2_PACKAGE_KMOD_USB_PRINTER
tristate "Support for USB printers"
default m
depends BR2_PACKAGE_KMOD_USB_CONTROLLER
config BR2_PACKAGE_KMOD_IDE
tristate "IDE support"
default m
help
Kernel modules for IDE support
useful for usb mass storage devices (e.g. on WL-HDD)
config BR2_PACKAGE_KMOD_VFAT
tristate "VFAT filesystem support"
default m
help
Kernel modules for VFAT filesystem support
useful for usb mass storage devices
config BR2_PACKAGE_KMOD_EXT2
tristate "EXT2 filesystem support"
default m
help
Kernel modules for EXT2 filesystem support
config BR2_PACKAGE_KMOD_EXT3
tristate "EXT3 filesystem support"
default m
help
Kernel modules for EXT3 filesystem support
config BR2_PACKAGE_KMOD_XFS
tristate "XFS filesystem support"
default m
help
Kernel modules for XFS filesystem support
config BR2_PACKAGE_KMOD_HFSPLUS
tristate "HFS+ filesystem support"
default m
help
Kernel modules for HFS+ filesystem support
config BR2_PACKAGE_KMOD_LOOP
tristate "loop mount support"
default m
help
Kernel module for loop mount support
config BR2_PACKAGE_KMOD_NBD
tristate "network block device"
default m
help
Kernel module for network block device
config BR2_PACKAGE_KMOD_LP
tristate "parallel port and lp support"
default m
help
Kernel modules for line printer and parallel port support
config BR2_PACKAGE_KMOD_CRYPTO
tristate "CryptoAPI modules"
default m
select BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE
help
Kernel modules for cryptographic algorithms
config BR2_PACKAGE_KMOD_PPP
tristate "PPP support"
default m
help
Kernel support for PPP
config BR2_PACKAGE_KMOD_MPPE
tristate "PPP MPPE/MPPC module"
default m
select BR2_PACKAGE_KMOD_CRYPTO
depends BR2_PACKAGE_KMOD_PPP
help
Support for Microsoft PPP Encryption/Compression
config BR2_PACKAGE_KMOD_PPPOE
tristate "PPPoE modules"
default m
depends BR2_PACKAGE_KMOD_PPP
help
Support for PPP over Ethernet
config BR2_PACKAGE_KMOD_TUN
tristate "Universal TUN/TAP driver"
default m
help
Kernel support for the TUN/TAP tunneling device
config BR2_PACKAGE_KMOD_GRE
tristate "GRE tunneling driver"
default m
help
Kernel support for GRE tunnels
config BR2_PACKAGE_KMOD_SCHED
tristate "Traffic schedulers"
default m
help
Kernel schedulers for IP traffic

View File

@@ -1,175 +0,0 @@
# $Id$
include $(TOPDIR)/rules.mk
include ./linux-2.4/linux.mk
include ./linux-2.4/linux.config
PKG_BUILD_DIR := $(BUILD_DIR)/linux-modules
PKG_RELEASE := 1
TARGETS :=
INSTALL_TARGETS :=
.NOTPARALLEL:
define KMOD_template
ifeq ($$(strip $(4)),)
KDEPEND_$(1):=m
else
KDEPEND_$(1):=$($(4))
endif
PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(LINUX_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
I_$(1) := $(PKG_BUILD_DIR)/ipkg/$(2)
ifeq ($$(KDEPEND_$(1)),m)
ifneq ($(BR2_PACKAGE_KMOD_$(1)),)
TARGETS += $$(PKG_$(1))
endif
ifeq ($(BR2_PACKAGE_KMOD_$(1)),y)
INSTALL_TARGETS += $$(PKG_$(1))
endif
endif
$$(PKG_$(1)): $(LINUX_DIR)/.modules_done
mkdir -p $$(I_$(1))/lib/modules/$(LINUX_VERSION)
$(SCRIPT_DIR)/make-ipkg-dir.sh $$(I_$(1)) control/kmod-$(2).control $(LINUX_VERSION)-$(PKG_RELEASE) $(ARCH)
cp $(3) $$(I_$(1))/lib/modules/$(LINUX_VERSION)
$(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR)
endef
$(eval $(call KMOD_template,DIAG,diag,\
$(MODULES_DIR)/kernel/drivers/net/diag/diag.o \
))
$(eval $(call KMOD_template,BRCM_WL,brcm-wl,\
$(MODULES_DIR)/kernel/drivers/net/wl/wl.o \
,CONFIG_WL))
$(eval $(call KMOD_template,B44,b44,\
$(MODULES_DIR)/kernel/drivers/net/b44.o \
,CONFIG_B44))
$(eval $(call KMOD_template,BRCM_ET,brcm-et,\
$(MODULES_DIR)/kernel/drivers/net/et/et.o \
,CONFIG_ET))
$(eval $(call KMOD_template,ARPT,arptables,\
$(MODULES_DIR)/kernel/net/ipv4/netfilter/arp*.o \
,CONFIG_IP_NF_ARPTABLES))
$(eval $(call KMOD_template,EBT,ebtables,\
$(MODULES_DIR)/kernel/net/bridge/netfilter/*.o \
,CONFIG_BRIDGE_NF_EBTABLES))
$(eval $(call KMOD_template,IPTABLES_V4,iptables,\
$(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_state.o \
$(MODULES_DIR)/kernel/net/ipv4/netfilter/iptable_nat.o \
$(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_nat_ftp.o \
$(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_conntrack.o \
$(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_conntrack.o \
$(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_conntrack_ftp.o \
$(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_MASQUERADE.o \
))
$(eval $(call KMOD_template,IPTABLES_V4_EXTRA,iptables-extra,\
$(MODULES_DIR)/kernel/net/ipv4/netfilter/ip*.o \
))
$(eval $(call KMOD_template,IPTABLES_V6,ip6tables,\
$(MODULES_DIR)/kernel/net/ipv6/netfilter/ip*.o \
,CONFIG_IP6_NF_IPTABLES))
$(eval $(call KMOD_template,IPV6,ipv6,\
$(MODULES_DIR)/kernel/net/ipv6/ipv6.o \
,CONFIG_IPV6))
$(eval $(call KMOD_template,CIFS,cifs,\
$(MODULES_DIR)/kernel/fs/cifs/cifs.o \
,CONFIG_CIFS))
$(eval $(call KMOD_template,NFS,nfs,\
$(MODULES_DIR)/kernel/fs/lockd/*.o \
$(MODULES_DIR)/kernel/fs/nfs/*.o \
$(MODULES_DIR)/kernel/net/sunrpc/*.o \
,CONFIG_NFS_FS))
$(eval $(call KMOD_template,USB,usb-core,\
$(MODULES_DIR)/kernel/drivers/usb/usbcore.o \
,CONFIG_USB))
$(eval $(call KMOD_template,USB_UHCI,usb-uhci,\
$(MODULES_DIR)/kernel/drivers/usb/host/uhci.o \
,CONFIG_USB_UHCI_ALT))
$(eval $(call KMOD_template,USB_OHCI,usb-ohci,\
$(MODULES_DIR)/kernel/drivers/usb/host/usb-ohci.o \
,CONFIG_USB_OHCI))
$(eval $(call KMOD_template,USB2,usb2,\
$(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd.o \
,CONFIG_USB_EHCI_HCD))
$(eval $(call KMOD_template,USB_STORAGE,usb-storage,\
$(MODULES_DIR)/kernel/drivers/scsi/*.o \
$(MODULES_DIR)/kernel/drivers/usb/storage/*.o \
,CONFIG_USB_STORAGE))
$(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
$(MODULES_DIR)/kernel/drivers/usb/printer.o \
,CONFIG_USB_PRINTER))
$(eval $(call KMOD_template,LOOP,loop,\
$(MODULES_DIR)/kernel/drivers/block/loop.o \
,CONFIG_BLK_DEV_LOOP))
$(eval $(call KMOD_template,NBD,nbd,\
$(MODULES_DIR)/kernel/drivers/block/nbd.o \
,CONFIG_BLK_DEV_NBD))
$(eval $(call KMOD_template,LP,lp,\
$(MODULES_DIR)/kernel/drivers/parport/parport.o \
$(MODULES_DIR)/kernel/drivers/parport/parport_splink.o \
$(MODULES_DIR)/kernel/drivers/char/lp.o \
,CONFIG_PARPORT))
$(eval $(call KMOD_template,IDE,ide,\
$(MODULES_DIR)/kernel/drivers/ide/*.o \
$(MODULES_DIR)/kernel/drivers/ide/*/*.o \
,CONFIG_IDE))
$(eval $(call KMOD_template,EXT2,ext2,\
$(MODULES_DIR)/kernel/fs/ext2/*.o \
,CONFIG_EXT2_FS))
$(eval $(call KMOD_template,EXT3,ext3,\
$(MODULES_DIR)/kernel/fs/ext3/*.o \
$(MODULES_DIR)/kernel/fs/jbd/*.o \
,CONFIG_EXT3_FS))
$(eval $(call KMOD_template,XFS,xfs,\
$(MODULES_DIR)/kernel/fs/xfs/*.o \
,CONFIG_XFS_FS))
$(eval $(call KMOD_template,HFSPLUS,hfsplus,\
$(MODULES_DIR)/kernel/fs/hfsplus/*.o \
,CONFIG_HFSPLUS_FS))
$(eval $(call KMOD_template,VFAT,vfat,\
$(MODULES_DIR)/kernel/fs/vfat/vfat.o \
$(MODULES_DIR)/kernel/fs/fat/fat.o \
,CONFIG_VFAT_FS))
$(eval $(call KMOD_template,CRYPTO,crypto,\
$(MODULES_DIR)/kernel/crypto/*.o \
))
$(eval $(call KMOD_template,PPP,ppp,\
$(MODULES_DIR)/kernel/drivers/net/ppp_async.o \
$(MODULES_DIR)/kernel/drivers/net/ppp_generic.o \
$(MODULES_DIR)/kernel/drivers/net/slhc.o \
,CONFIG_PPP))
$(eval $(call KMOD_template,MPPE,mppe,\
$(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.o \
,CONFIG_PPP_MPPE_MPPC))
$(eval $(call KMOD_template,PPPOE,pppoe,\
$(MODULES_DIR)/kernel/drivers/net/pppoe.o \
$(MODULES_DIR)/kernel/drivers/net/pppox.o \
,CONFIG_PPPOE))
$(eval $(call KMOD_template,TUN,tun,\
$(MODULES_DIR)/kernel/drivers/net/tun.o \
,CONFIG_TUN))
$(eval $(call KMOD_template,GRE,gre,\
$(MODULES_DIR)/kernel/net/ipv4/ip_gre.o \
,CONFIG_NET_IPGRE))
$(eval $(call KMOD_template,SCHED,sched,\
$(MODULES_DIR)/kernel/net/sched/*.o \
))
$(TARGETS): $(PACKAGE_DIR)
$(PACKAGE_DIR):
mkdir -p $(PACKAGE_DIR)
source: linux-source
prepare: $(LINUX_DIR)/.configured
compile: $(LINUX_DIR)/.modules_done $(TARGETS)
install: compile $(TARGET_MODULES_DIR)
@[ "$(INSTALL_TARGETS)" != "" ] && $(IPKG) install $(INSTALL_TARGETS) || true
clean: linux-dirclean
rm -f $(TARGETS)

View File

@@ -1,6 +0,0 @@
Package: kmod-arptables
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: ARP firewalling kernel modules

View File

@@ -1,6 +0,0 @@
Package: kmod-b44
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Free driver for Broadcom 44Xx, 47XX Ethernet chipset

View File

@@ -1,6 +0,0 @@
Package: kmod-brcm-et
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Proprietary driver for Broadcom Ethernet chipsets

View File

@@ -1,6 +0,0 @@
Package: kmod-brcm-wl
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Proprietary driver for Broadcom Wireless chipsets

View File

@@ -1,6 +0,0 @@
Package: kmod-cifs
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for CIFS support

View File

@@ -1,6 +0,0 @@
Package: kmod-crypto
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: CryptoAPI kernel modules

View File

@@ -1,6 +0,0 @@
Package: kmod-diag
Priority: essential
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Driver for Router LEDs and Buttons

View File

@@ -1,6 +0,0 @@
Package: kmod-ebtables
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Ethernet bridge firewalling kernel modules

View File

@@ -1,6 +0,0 @@
Package: kmod-ext2
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for EXT2 filesystem support

View File

@@ -1,6 +0,0 @@
Package: kmod-ext3
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for EXT3 filesystem support

View File

@@ -1,6 +0,0 @@
Package: kmod-gre
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel GRE tunneling support

View File

@@ -1,6 +0,0 @@
Package: kmod-hfsplus
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for HFS+ filesystem support

View File

@@ -1,6 +0,0 @@
Package: kmod-ide
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules IDE support

View File

@@ -1,7 +0,0 @@
Package: kmod-ip6tables
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for ip6tables
Depends: kmod-ipv6

View File

@@ -1,6 +0,0 @@
Package: kmod-iptables-extra
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Extra kernel modules for iptables

View File

@@ -1,6 +0,0 @@
Package: kmod-iptables
Priority: optional
Section: net
Maintainer: OpenWrt Development Team <bugs@openwrt.org>
Source: buildroot internal
Description: kernel modules for iptables

View File

@@ -1,6 +0,0 @@
Package: kmod-ipv6
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for the IPv6 protocol

View File

@@ -1,6 +0,0 @@
Package: kmod-loop
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@dass-it.de>
Source: buildroot internal
Description: Kernel module for mount loopback support

View File

@@ -1,6 +0,0 @@
Package: kmod-lp
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@dass-it.de>
Source: buildroot internal
Description: Kernel modules for parallel port support and line printer

View File

@@ -1,6 +0,0 @@
Package: kmod-mppe
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Microsoft PPP Encryption/Compression support

View File

@@ -1,6 +0,0 @@
Package: kmod-nbd
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@dass-it.de>
Source: buildroot internal
Description: Kernel module for network block device

View File

@@ -1,6 +0,0 @@
Package: kmod-nfs
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for NFS support

View File

@@ -1,6 +0,0 @@
Package: kmod-ppp
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: PPP support

View File

@@ -1,6 +0,0 @@
Package: kmod-pppoe
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: PPP over Ethernet support

View File

@@ -1,6 +0,0 @@
Package: kmod-sched
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel schedulers for IP traffic

View File

@@ -1,6 +0,0 @@
Package: kmod-tun
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel TUN/TAP extension

View File

@@ -1,6 +0,0 @@
Package: kmod-usb-core
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel Support for USB

View File

@@ -1,7 +0,0 @@
Package: kmod-usb-ohci
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Depends: kmod-usb-core
Description: Kernel driver for OHCI USB controllers

View File

@@ -1,6 +0,0 @@
Package: kmod-usb-printer
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for USB Printer support

View File

@@ -1,6 +0,0 @@
Package: kmod-usb-storage
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for USB storage support

View File

@@ -1,7 +0,0 @@
Package: kmod-usb-uhci
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Depends: kmod-usb-core
Description: Kernel driver for UHCI USB controllers

View File

@@ -1,7 +0,0 @@
Package: kmod-usb2
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Depends: kmod-usb-core
Description: Kernel driver for USB2 controllers

View File

@@ -1,6 +0,0 @@
Package: kmod-vfat
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@dass-it.de>
Source: buildroot internal
Description: Kernel modules for VFAT filesystem support

View File

@@ -1,6 +0,0 @@
Package: kmod-xfs
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for XFS filesystem support

File diff suppressed because it is too large Load Diff

View File

@@ -1,43 +0,0 @@
--- ../../../kernel/linux-mips-cvs/Makefile 2005-01-20 03:19:21.000000000 +0100
+++ linux-2.4.29.new/Makefile 2005-03-15 01:15:27.441095231 +0100
@@ -17,9 +17,9 @@
FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
HOSTCC = gcc
-HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS = -Wall -Wstrict-prototypes -Os -fomit-frame-pointer
-CROSS_COMPILE =
+CROSS_COMPILE=
#
# Include the make variables (CC, etc...)
@@ -91,8 +91,18 @@
CPPFLAGS := -D__KERNEL__ -I$(HPATH)
-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
-fno-strict-aliasing -fno-common
+
+
+# Turn on -pg to instrument the kernel with calls to mcount().
+# Unfortunately, gcc won't allow -pg without frame pointers.
+ifdef CONFIG_MCOUNT
+ CFLAGS += -pg
+ CFLAGS_KERNEL += -pg
+ CONFIG_FRAME_POINTER = 1
+endif
+
ifndef CONFIG_FRAME_POINTER
CFLAGS += -fomit-frame-pointer
endif
@@ -501,7 +511,7 @@
ifdef CONFIG_MODVERSIONS
$(MAKE) update-modverfile
endif
- scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
+ (find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs -r scripts/mkdep -- ) > .hdepend
scripts/mkdep -- init/*.c > .depend
ifdef CONFIG_MODVERSIONS

View File

@@ -1,18 +0,0 @@
--- linux-mips-cvs/Rules.make 2003-08-13 17:39:03.000000000 +0200
+++ linux-broadcom/Rules.make 2005-01-31 13:13:14.000000000 +0100
@@ -176,7 +176,14 @@
_modinst__: dummy
ifneq "$(strip $(ALL_MOBJS))" ""
mkdir -p $(MODLIB)/kernel/$(MOD_DESTDIR)
- cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
+ @#cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
+ for f in $(ALL_MOBJS) ; do \
+ $(OBJCOPY) -R __ksymtab -R .comment -R .note -x \
+ `$(NM) $$f | cut -f3- -d' ' | sed -n \
+ -e 's/__module_parm_\(.*\)/-K \1/p' \
+ -e 's/__ks..tab_\(.*\)/-K \1/p'` \
+ $$f $(MODLIB)/kernel/$(MOD_DESTDIR)$(MOD_TARGET)$$f ; \
+ done
endif
.PHONY: modules_install

View File

@@ -1,42 +0,0 @@
--- linux-mips-cvs/arch/mips/Makefile 2005-01-31 12:59:28.000000000 +0100
+++ linux-broadcom/arch/mips/Makefile 2005-01-31 13:13:14.000000000 +0100
@@ -47,9 +47,9 @@
GCCFLAGS += -G 0 -mno-abicalls -fno-pic -pipe
GCCFLAGS += $(call check_gcc, -finline-limit=100000,)
LINKFLAGS += -G 0 -static -n
-MODFLAGS += -mlong-calls
+MODFLAGS += -mlong-calls -fno-common
-ifdef CONFIG_DEBUG_INFO
+ifdef CONFIG_REMOTE_DEBUG
GCCFLAGS += -g
ifdef CONFIG_SB1XXX_CORELIS
GCCFLAGS += -mno-sched-prolog -fno-omit-frame-pointer
@@ -174,6 +174,7 @@
endif
AFLAGS += $(GCCFLAGS)
+ASFLAGS += $(GCCFLAGS)
CFLAGS += $(GCCFLAGS)
LD += -m $(ld-emul)
@@ -727,6 +728,19 @@
endif
#
+# Broadcom BCM947XX variants
+#
+ifdef CONFIG_BCM947XX
+LIBS += arch/mips/brcm-boards/generic/brcm.o arch/mips/brcm-boards/bcm947xx/bcm947xx.o
+SUBDIRS += arch/mips/brcm-boards/generic arch/mips/brcm-boards/bcm947xx
+LOADADDR := 0x80001000
+
+zImage: vmlinux
+ $(MAKE) -C arch/$(ARCH)/brcm-boards/bcm947xx/compressed
+export LOADADDR
+endif
+
+#
# Choosing incompatible machines durings configuration will result in
# error messages during linking. Select a default linkscript if
# none has been choosen above.

View File

@@ -1,56 +0,0 @@
--- ../../../kernel/linux-mips-cvs/arch/mips/config-shared.in 2005-01-31 12:59:28.000000000 +0100
+++ linux-2.4.29/arch/mips/config-shared.in 2005-03-12 19:51:22.474214917 +0100
@@ -208,6 +208,14 @@
fi
define_bool CONFIG_MIPS_RTC y
fi
+dep_bool 'Support for Broadcom MIPS-based boards' CONFIG_MIPS_BRCM $CONFIG_EXPERIMENTAL
+dep_bool 'Support for Broadcom BCM947XX' CONFIG_BCM947XX $CONFIG_MIPS_BRCM
+if [ "$CONFIG_BCM947XX" = "y" ] ; then
+ bool ' Support for Broadcom BCM4710' CONFIG_BCM4710
+ bool ' Support for Broadcom BCM4310' CONFIG_BCM4310
+ bool ' Support for Broadcom BCM4704' CONFIG_BCM4704
+ bool ' Support for Broadcom BCM5365' CONFIG_BCM5365
+fi
bool 'Support for SNI RM200 PCI' CONFIG_SNI_RM200_PCI
bool 'Support for TANBAC TB0226 (Mbase)' CONFIG_TANBAC_TB0226
bool 'Support for TANBAC TB0229 (VR4131DIMM)' CONFIG_TANBAC_TB0229
@@ -229,6 +237,11 @@
define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
#
+# Provide an option for a default kernel command line
+#
+string 'Default kernel command string' CONFIG_CMDLINE ""
+
+#
# Select some configuration options automatically based on user selections.
#
if [ "$CONFIG_ACER_PICA_61" = "y" ]; then
@@ -554,6 +567,13 @@
define_bool CONFIG_SWAP_IO_SPACE_L y
define_bool CONFIG_BOOT_ELF32 y
fi
+if [ "$CONFIG_BCM947XX" = "y" ] ; then
+ define_bool CONFIG_PCI y
+ define_bool CONFIG_NONCOHERENT_IO y
+ define_bool CONFIG_NEW_TIME_C y
+ define_bool CONFIG_NEW_IRQ y
+ define_bool CONFIG_HND y
+fi
if [ "$CONFIG_SNI_RM200_PCI" = "y" ]; then
define_bool CONFIG_ARC32 y
define_bool CONFIG_ARC_MEMORY y
@@ -1039,7 +1059,11 @@
bool 'Are you using a crosscompiler' CONFIG_CROSSCOMPILE
bool 'Enable run-time debugging' CONFIG_RUNTIME_DEBUG
-bool 'Remote GDB kernel debugging' CONFIG_KGDB
+if [ "$CONFIG_BCM947XX" = "y" ] ; then
+ bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
+else
+ bool 'Remote GDB kernel debugging' CONFIG_KGDB
+fi
dep_bool ' Console output to GDB' CONFIG_GDB_CONSOLE $CONFIG_KGDB
if [ "$CONFIG_KGDB" = "y" ]; then
define_bool CONFIG_DEBUG_INFO y

View File

@@ -1,121 +0,0 @@
--- linux-mips-cvs/arch/mips/kernel/cpu-probe.c 2005-01-31 12:59:30.000000000 +0100
+++ linux-broadcom/arch/mips/kernel/cpu-probe.c 2005-01-31 13:13:14.000000000 +0100
@@ -175,7 +175,7 @@
static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
{
- switch (c->processor_id & 0xff00) {
+ switch (c->processor_id & PRID_IMP_MASK) {
case PRID_IMP_R2000:
c->cputype = CPU_R2000;
c->isa_level = MIPS_CPU_ISA_I;
@@ -185,7 +185,7 @@
c->tlbsize = 64;
break;
case PRID_IMP_R3000:
- if ((c->processor_id & 0xff) == PRID_REV_R3000A)
+ if ((c->processor_id & PRID_REV_MASK) == PRID_REV_R3000A)
if (cpu_has_confreg())
c->cputype = CPU_R3081E;
else
@@ -200,12 +200,12 @@
break;
case PRID_IMP_R4000:
if (read_c0_config() & CONF_SC) {
- if ((c->processor_id & 0xff) >= PRID_REV_R4400)
+ if ((c->processor_id & PRID_REV_MASK) >= PRID_REV_R4400)
c->cputype = CPU_R4400PC;
else
c->cputype = CPU_R4000PC;
} else {
- if ((c->processor_id & 0xff) >= PRID_REV_R4400)
+ if ((c->processor_id & PRID_REV_MASK) >= PRID_REV_R4400)
c->cputype = CPU_R4400SC;
else
c->cputype = CPU_R4000SC;
@@ -451,7 +451,7 @@
static inline void cpu_probe_mips(struct cpuinfo_mips *c)
{
decode_config1(c);
- switch (c->processor_id & 0xff00) {
+ switch (c->processor_id & PRID_IMP_MASK) {
case PRID_IMP_4KC:
c->cputype = CPU_4KC;
c->isa_level = MIPS_CPU_ISA_M32;
@@ -492,10 +492,10 @@
{
decode_config1(c);
c->options |= MIPS_CPU_PREFETCH;
- switch (c->processor_id & 0xff00) {
+ switch (c->processor_id & PRID_IMP_MASK) {
case PRID_IMP_AU1_REV1:
case PRID_IMP_AU1_REV2:
- switch ((c->processor_id >> 24) & 0xff) {
+ switch ((c->processor_id >> 24) & PRID_REV_MASK) {
case 0:
c->cputype = CPU_AU1000;
break;
@@ -523,10 +523,34 @@
}
}
+static inline void cpu_probe_broadcom(struct cpuinfo_mips *c)
+{
+ decode_config1(c);
+ c->options |= MIPS_CPU_PREFETCH;
+ switch (c->processor_id & PRID_IMP_MASK) {
+ case PRID_IMP_BCM4710:
+ c->cputype = CPU_BCM4710;
+ c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
+ MIPS_CPU_4KTLB | MIPS_CPU_COUNTER;
+ c->scache.flags = MIPS_CACHE_NOT_PRESENT;
+ break;
+ case PRID_IMP_4KC:
+ case PRID_IMP_BCM3302:
+ c->cputype = CPU_BCM3302;
+ c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
+ MIPS_CPU_4KTLB | MIPS_CPU_COUNTER;
+ c->scache.flags = MIPS_CACHE_NOT_PRESENT;
+ break;
+ default:
+ c->cputype = CPU_UNKNOWN;
+ break;
+ }
+}
+
static inline void cpu_probe_sibyte(struct cpuinfo_mips *c)
{
decode_config1(c);
- switch (c->processor_id & 0xff00) {
+ switch (c->processor_id & PRID_IMP_MASK) {
case PRID_IMP_SB1:
c->cputype = CPU_SB1;
c->isa_level = MIPS_CPU_ISA_M64;
@@ -548,7 +572,7 @@
static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c)
{
decode_config1(c);
- switch (c->processor_id & 0xff00) {
+ switch (c->processor_id & PRID_IMP_MASK) {
case PRID_IMP_SR71000:
c->cputype = CPU_SR71000;
c->isa_level = MIPS_CPU_ISA_M64;
@@ -573,7 +597,7 @@
c->cputype = CPU_UNKNOWN;
c->processor_id = read_c0_prid();
- switch (c->processor_id & 0xff0000) {
+ switch (c->processor_id & PRID_COMP_MASK) {
case PRID_COMP_LEGACY:
cpu_probe_legacy(c);
@@ -584,6 +608,9 @@
case PRID_COMP_ALCHEMY:
cpu_probe_alchemy(c);
break;
+ case PRID_COMP_BROADCOM:
+ cpu_probe_broadcom(c);
+ break;
case PRID_COMP_SIBYTE:
cpu_probe_sibyte(c);
break;

View File

@@ -1,24 +0,0 @@
--- linux-mips-cvs/arch/mips/kernel/head.S 2004-11-22 14:38:23.000000000 +0100
+++ linux-broadcom/arch/mips/kernel/head.S 2005-01-31 13:13:14.000000000 +0100
@@ -28,12 +28,20 @@
#include <asm/mipsregs.h>
#include <asm/stackframe.h>
+#ifdef CONFIG_BCM4710
+#undef eret
+#define eret nop; nop; eret
+#endif
+
.text
+ j kernel_entry
+ nop
+
/*
* Reserved space for exception handlers.
* Necessary for machines which link their kernels at KSEG0.
*/
- .fill 0x400
+ .fill 0x3f4
/* The following two symbols are used for kernel profiling. */
EXPORT(stext)

View File

@@ -1,14 +0,0 @@
--- linux-mips-cvs/arch/mips/kernel/proc.c 2004-07-07 20:19:37.000000000 +0200
+++ linux-broadcom/arch/mips/kernel/proc.c 2005-01-31 13:58:35.000000000 +0100
@@ -78,9 +78,10 @@
[CPU_AU1550] "Au1550",
[CPU_24K] "MIPS 24K",
[CPU_AU1200] "Au1200",
+ [CPU_BCM4710] "BCM4710",
+ [CPU_BCM3302] "BCM3302",
};
-
static int show_cpuinfo(struct seq_file *m, void *v)
{
unsigned int version = current_cpu_data.processor_id;

View File

@@ -1,22 +0,0 @@
--- linux-mips-cvs/arch/mips/kernel/setup.c 2005-01-13 22:15:57.000000000 +0100
+++ linux-broadcom/arch/mips/kernel/setup.c 2005-01-31 13:13:14.000000000 +0100
@@ -493,6 +493,7 @@
void swarm_setup(void);
void hp_setup(void);
void au1x00_setup(void);
+ void brcm_setup(void);
void frame_info_init(void);
frame_info_init();
@@ -691,6 +692,11 @@
pmc_yosemite_setup();
break;
#endif
+#if defined(CONFIG_BCM4710) || defined(CONFIG_BCM4310)
+ case MACH_GROUP_BRCM:
+ brcm_setup();
+ break;
+#endif
default:
panic("Unsupported architecture");
}

View File

@@ -1,31 +0,0 @@
--- linux-mips-cvs/arch/mips/kernel/traps.c 2004-11-22 14:38:23.000000000 +0100
+++ linux-broadcom/arch/mips/kernel/traps.c 2005-01-31 13:13:14.000000000 +0100
@@ -919,6 +919,7 @@
void __init trap_init(void)
{
extern char except_vec1_generic;
+ extern char except_vec2_generic;
extern char except_vec3_generic, except_vec3_r4000;
extern char except_vec_ejtag_debug;
extern char except_vec4;
@@ -926,6 +927,7 @@
/* Copy the generic exception handler code to it's final destination. */
memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80);
+ memcpy((void *)(KSEG0 + 0x100), &except_vec2_generic, 0x80);
/*
* Setup default vectors
@@ -984,6 +986,12 @@
set_except_vector(13, handle_tr);
set_except_vector(22, handle_mdmx);
+ if (current_cpu_data.cputype == CPU_SB1) {
+ /* Enable timer interrupt and scd mapped interrupt */
+ clear_c0_status(0xf000);
+ set_c0_status(0xc00);
+ }
+
if (cpu_has_fpu && !cpu_has_nofpuex)
set_except_vector(15, handle_fpe);

View File

@@ -1,12 +0,0 @@
--- linux-mips-cvs/arch/mips/pci/Makefile 2004-07-31 02:12:38.000000000 +0200
+++ linux-broadcom/arch/mips/pci/Makefile 2005-01-31 13:13:14.000000000 +0100
@@ -13,7 +13,9 @@
obj-$(CONFIG_MIPS_MSC) += ops-msc.o
obj-$(CONFIG_MIPS_NILE4) += ops-nile4.o
obj-$(CONFIG_SNI_RM200_PCI) += ops-sni.o
+ifndef CONFIG_BCM947XX
obj-y += pci.o
+endif
obj-$(CONFIG_PCI_AUTO) += pci_auto.o
include $(TOPDIR)/Rules.make

View File

@@ -1,12 +0,0 @@
--- linux-mips-cvs/drivers/char/mem.c 2004-08-14 20:38:49.000000000 +0200
+++ linux-broadcom/drivers/char/mem.c 2005-01-31 13:13:14.000000000 +0100
@@ -713,7 +713,8 @@
{1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops},
{2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops},
{3, "null", S_IRUGO | S_IWUGO, &null_fops},
-#if defined(CONFIG_ISA) || !defined(__mc68000__)
+#if defined(CONFIG_ISA) || !defined(__mc68000__) || \
+ defined(CONFIG_BCM94702_CPCI)
{4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops},
#endif
{5, "zero", S_IRUGO | S_IWUGO, &zero_fops},

View File

@@ -1,37 +0,0 @@
--- linux-mips-cvs/drivers/char/serial.c 2004-12-27 05:13:43.000000000 +0100
+++ linux-broadcom/drivers/char/serial.c 2005-01-31 13:13:14.000000000 +0100
@@ -444,6 +444,10 @@
return inb(info->port+1);
#endif
case SERIAL_IO_MEM:
+#ifdef CONFIG_BCM4310
+ readb((unsigned long) info->iomem_base +
+ (UART_SCR<<info->iomem_reg_shift));
+#endif
return readb((unsigned long) info->iomem_base +
(offset<<info->iomem_reg_shift));
default:
@@ -464,6 +468,9 @@
case SERIAL_IO_MEM:
writeb(value, (unsigned long) info->iomem_base +
(offset<<info->iomem_reg_shift));
+#ifdef CONFIG_BCM4704
+ *((volatile unsigned int *) KSEG1ADDR(0x18000000));
+#endif
break;
default:
outb(value, info->port+offset);
@@ -5996,6 +6003,13 @@
* Divisor, bytesize and parity
*/
state = rs_table + co->index;
+ /*
+ * Safe guard: state structure must have been initialized
+ */
+ if (state->iomem_base == NULL) {
+ printk("!unable to setup serial console!\n");
+ return -1;
+ }
if (doflow)
state->flags |= ASYNC_CONS_FLOW;
info = &async_sercons;

View File

@@ -1,105 +0,0 @@
diff -Nur linux-mips-cvs/drivers/mtd/chips/Config.in linux-broadcom/drivers/mtd/chips/Config.in
--- linux-mips-cvs/drivers/mtd/chips/Config.in 2003-02-26 01:53:49.000000000 +0100
+++ linux-broadcom/drivers/mtd/chips/Config.in 2005-01-31 13:13:14.000000000 +0100
@@ -45,6 +45,7 @@
dep_tristate ' Support for Intel/Sharp flash chips' CONFIG_MTD_CFI_INTELEXT $CONFIG_MTD_GEN_PROBE
dep_tristate ' Support for AMD/Fujitsu flash chips' CONFIG_MTD_CFI_AMDSTD $CONFIG_MTD_GEN_PROBE
dep_tristate ' Support for ST (Advanced Architecture) flash chips' CONFIG_MTD_CFI_STAA $CONFIG_MTD_GEN_PROBE
+dep_tristate ' Support for SST flash chips' CONFIG_MTD_CFI_SSTSTD $CONFIG_MTD_GEN_PROBE
dep_tristate ' Support for RAM chips in bus mapping' CONFIG_MTD_RAM $CONFIG_MTD
dep_tristate ' Support for ROM chips in bus mapping' CONFIG_MTD_ROM $CONFIG_MTD
diff -Nur linux-mips-cvs/drivers/mtd/chips/Makefile linux-broadcom/drivers/mtd/chips/Makefile
--- linux-mips-cvs/drivers/mtd/chips/Makefile 2003-07-05 05:23:38.000000000 +0200
+++ linux-broadcom/drivers/mtd/chips/Makefile 2005-01-31 13:13:14.000000000 +0100
@@ -18,6 +18,7 @@
obj-$(CONFIG_MTD_AMDSTD) += amd_flash.o
obj-$(CONFIG_MTD_CFI) += cfi_probe.o
obj-$(CONFIG_MTD_CFI_STAA) += cfi_cmdset_0020.o
+obj-$(CONFIG_MTD_CFI_SSTSTD) += cfi_cmdset_0701.o
obj-$(CONFIG_MTD_CFI_AMDSTD) += cfi_cmdset_0002.o
obj-$(CONFIG_MTD_CFI_INTELEXT) += cfi_cmdset_0001.o
obj-$(CONFIG_MTD_GEN_PROBE) += gen_probe.o
diff -Nur linux-mips-cvs/drivers/mtd/chips/cfi_probe.c linux-broadcom/drivers/mtd/chips/cfi_probe.c
--- linux-mips-cvs/drivers/mtd/chips/cfi_probe.c 2003-02-26 01:53:49.000000000 +0100
+++ linux-broadcom/drivers/mtd/chips/cfi_probe.c 2005-01-31 13:13:14.000000000 +0100
@@ -67,8 +67,15 @@
cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
- if (!qry_present(map,base,cfi))
- return 0;
+ if (!qry_present(map,base,cfi)) {
+ /* rather broken SST cfi probe (requires SST unlock) */
+ cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
+ cfi_send_gen_cmd(0xAA, 0x5555, base, map, cfi, cfi->device_type, NULL);
+ cfi_send_gen_cmd(0x55, 0x2AAA, base, map, cfi, cfi->device_type, NULL);
+ cfi_send_gen_cmd(0x98, 0x5555, base, map, cfi, cfi->device_type, NULL);
+ if (!qry_present(map,base,cfi))
+ return 0;
+ }
if (!cfi->numchips) {
/* This is the first time we're called. Set up the CFI
diff -Nur linux-mips-cvs/drivers/mtd/chips/gen_probe.c linux-broadcom/drivers/mtd/chips/gen_probe.c
--- linux-mips-cvs/drivers/mtd/chips/gen_probe.c 2003-08-13 19:19:18.000000000 +0200
+++ linux-broadcom/drivers/mtd/chips/gen_probe.c 2005-01-31 13:13:14.000000000 +0100
@@ -332,9 +332,13 @@
return cfi_cmdset_0002(map, primary);
#endif
#ifdef CONFIG_MTD_CFI_STAA
- case 0x0020:
+ case 0x0020:
return cfi_cmdset_0020(map, primary);
#endif
+#ifdef CONFIG_MTD_CFI_SSTSTD
+ case 0x0701:
+ return cfi_cmdset_0701(map, primary);
+#endif
}
return cfi_cmdset_unknown(map, primary);
diff -Nur linux-mips-cvs/drivers/mtd/devices/Config.in linux-broadcom/drivers/mtd/devices/Config.in
--- linux-mips-cvs/drivers/mtd/devices/Config.in 2003-02-26 01:53:49.000000000 +0100
+++ linux-broadcom/drivers/mtd/devices/Config.in 2005-01-31 13:13:14.000000000 +0100
@@ -5,6 +5,7 @@
mainmenu_option next_comment
comment 'Self-contained MTD device drivers'
+bool ' Broadcom Chipcommon Serial Flash support' CONFIG_MTD_SFLASH
dep_tristate ' Ramix PMC551 PCI Mezzanine RAM card support' CONFIG_MTD_PMC551 $CONFIG_MTD $CONFIG_PCI
if [ "$CONFIG_MTD_PMC551" = "y" -o "$CONFIG_MTD_PMC551" = "m" ]; then
bool ' PMC551 256M DRAM Bugfix' CONFIG_MTD_PMC551_BUGFIX
diff -Nur linux-mips-cvs/drivers/mtd/devices/Makefile linux-broadcom/drivers/mtd/devices/Makefile
--- linux-mips-cvs/drivers/mtd/devices/Makefile 2002-03-30 09:15:50.000000000 +0100
+++ linux-broadcom/drivers/mtd/devices/Makefile 2005-01-31 13:13:14.000000000 +0100
@@ -12,6 +12,7 @@
# here where previously there was none. We now have to ensure that
# doc200[01].o are linked before docprobe.o
+obj-$(CONFIG_MTD_SFLASH) += sflash.o
obj-$(CONFIG_MTD_DOC1000) += doc1000.o
obj-$(CONFIG_MTD_DOC2000) += doc2000.o
obj-$(CONFIG_MTD_DOC2001) += doc2001.o
diff -Nur linux-mips-cvs/drivers/mtd/maps/Config.in linux-broadcom/drivers/mtd/maps/Config.in
--- linux-mips-cvs/drivers/mtd/maps/Config.in 2004-02-26 01:46:35.000000000 +0100
+++ linux-broadcom/drivers/mtd/maps/Config.in 2005-01-31 13:13:14.000000000 +0100
@@ -48,6 +48,7 @@
fi
if [ "$CONFIG_MIPS" = "y" ]; then
+ dep_tristate ' CFI Flash device mapped on Broadcom BCM947XX boards' CONFIG_MTD_BCM947XX $CONFIG_MTD_CFI
dep_tristate ' Pb1000 MTD support' CONFIG_MTD_PB1000 $CONFIG_MIPS_PB1000
dep_tristate ' Pb1500 MTD support' CONFIG_MTD_PB1500 $CONFIG_MIPS_PB1500
dep_tristate ' Pb1100 MTD support' CONFIG_MTD_PB1100 $CONFIG_MIPS_PB1100
diff -Nur linux-mips-cvs/drivers/mtd/maps/Makefile linux-broadcom/drivers/mtd/maps/Makefile
--- linux-mips-cvs/drivers/mtd/maps/Makefile 2004-02-26 01:46:35.000000000 +0100
+++ linux-broadcom/drivers/mtd/maps/Makefile 2005-01-31 13:13:14.000000000 +0100
@@ -10,6 +10,7 @@
endif
# Chip mappings
+obj-$(CONFIG_MTD_BCM947XX) += bcm947xx-flash.o
obj-$(CONFIG_MTD_CDB89712) += cdb89712.o
obj-$(CONFIG_MTD_ARM_INTEGRATOR)+= integrator-flash.o
obj-$(CONFIG_MTD_CFI_FLAGADM) += cfi_flagadm.o

View File

@@ -1,10 +0,0 @@
--- linux-mips-cvs/drivers/net/Config.in 2004-11-07 18:13:42.000000000 +0100
+++ linux-broadcom/drivers/net/Config.in 2005-01-31 13:13:14.000000000 +0100
@@ -2,6 +2,7 @@
# Network device configuration
#
+source drivers/net/hnd/Config.in
source drivers/net/arcnet/Config.in
tristate 'Dummy net driver support' CONFIG_DUMMY

View File

@@ -1,48 +0,0 @@
--- ../../../kernel/linux-mips-cvs/drivers/net/Makefile 2004-08-14 20:38:51.000000000 +0200
+++ linux/drivers/net/Makefile 2005-03-16 12:45:24.523263597 +0100
@@ -21,6 +21,16 @@
list-multi := rcpci.o
rcpci-objs := rcpci45.o rclanmtl.o
+subdir-m += diag
+
+ifeq ($(CONFIG_HW_QOS),y)
+subdir-m += port_based_qos
+else
+ ifeq ($(CONFIG_PERFORMANCE),y)
+ subdir-m += port_based_qos
+ endif
+endif
+
ifeq ($(CONFIG_TULIP),y)
obj-y += tulip/tulip.o
endif
@@ -265,6 +275,28 @@
endif
endif
+#
+# Broadcom HND devices
+#
+ifdef CONFIG_HND
+subdir-$(CONFIG_HND) += hnd
+endif
+ifdef CONFIG_ET
+subdir-$(CONFIG_ET) += et
+endif
+ifdef CONFIG_WL
+subdir-$(CONFIG_WL) += wl
+endif
+ifeq ($(CONFIG_HND),y)
+ obj-y += hnd/hnd.o
+endif
+ifeq ($(CONFIG_ET),y)
+ obj-y += et/et.o
+endif
+ifeq ($(CONFIG_WL),y)
+ obj-y += wl/wl.o
+endif
+
include $(TOPDIR)/Rules.make
clean:

View File

@@ -1,10 +0,0 @@
--- ../../../kernel/linux-mips-cvs/drivers/parport/Makefile 2004-08-14 20:38:53.000000000 +0200
+++ linux-2.4.29/drivers/parport/Makefile 2005-03-21 13:57:53.338746517 +0100
@@ -22,6 +22,7 @@
obj-$(CONFIG_PARPORT) += parport.o
obj-$(CONFIG_PARPORT_PC) += parport_pc.o
+obj-$(CONFIG_PARPORT_SPLINK) += parport_splink.o
obj-$(CONFIG_PARPORT_PC_PCMCIA) += parport_cs.o
obj-$(CONFIG_PARPORT_AMIGA) += parport_amiga.o
obj-$(CONFIG_PARPORT_MFC3) += parport_mfc3.o

View File

@@ -1,10 +0,0 @@
--- ../../../kernel/linux-mips-cvs/drivers/parport/Config.in 2004-02-20 02:22:18.000000000 +0100
+++ linux-2.4.29/drivers/parport/Config.in 2005-03-21 13:59:33.958193664 +0100
@@ -11,6 +11,7 @@
tristate 'Parallel port support' CONFIG_PARPORT
if [ "$CONFIG_PARPORT" != "n" ]; then
dep_tristate ' PC-style hardware' CONFIG_PARPORT_PC $CONFIG_PARPORT
+ dep_tristate ' Asus WL500g parallel port' CONFIG_PARPORT_SPLINK $CONFIG_PARPORT
if [ "$CONFIG_PARPORT_PC" != "n" -a "$CONFIG_SERIAL" != "n" ]; then
if [ "$CONFIG_SERIAL" = "m" ]; then
define_tristate CONFIG_PARPORT_PC_CML1 m

View File

@@ -1,23 +0,0 @@
diff -Nur linux-mips-cvs/drivers/pcmcia/Makefile linux-broadcom/drivers/pcmcia/Makefile
--- linux-mips-cvs/drivers/pcmcia/Makefile 2004-04-16 23:05:25.000000000 +0200
+++ linux-broadcom/drivers/pcmcia/Makefile 2005-01-31 13:13:14.000000000 +0100
@@ -72,6 +72,10 @@
au1000_ss-objs-$(CONFIG_MIPS_HYDROGEN3) += au1000_hydrogen3.o
au1000_ss-objs-$(CONFIG_MIPS_XXS1500) += au1000_xxs1500.o
+obj-$(CONFIG_PCMCIA_BCM4710) += bcm4710_ss.o
+bcm4710_ss-objs := bcm4710_generic.o
+bcm4710_ss-objs += bcm4710_pcmcia.o
+
obj-$(CONFIG_PCMCIA_SA1100) += sa1100_cs.o
obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o
obj-$(CONFIG_PCMCIA_SIBYTE) += sibyte_generic.o
@@ -110,5 +114,8 @@
au1x00_ss.o: $(au1000_ss-objs-y)
$(LD) -r -o $@ $(au1000_ss-objs-y)
+bcm4710_ss.o: $(bcm4710_ss-objs)
+ $(LD) -r -o $@ $(bcm4710_ss-objs)
+
yenta_socket.o: $(yenta_socket-objs)
$(LD) $(LD_RFLAG) -r -o $@ $(yenta_socket-objs)

View File

@@ -1,37 +0,0 @@
--- linux-mips-cvs/arch/mips/mm/c-r4k.c 2004-11-03 17:43:07.000000000 +0100
+++ linux-cache/arch/mips/mm/c-r4k.c 2005-03-06 23:39:53.000000000 +0100
@@ -1031,9 +1031,34 @@
c->options |= MIPS_CPU_SUBSET_CACHES;
}
+#if defined(CONFIG_BCM4310)
+static void __init _change_cachability(u32 cm)
+{
+ struct cpuinfo_mips *c = &current_cpu_data;
+
+ change_c0_config(CONF_CM_CMASK, cm);
+ if ((c->processor_id & (PRID_COMP_MASK | PRID_IMP_MASK)) ==
+ (PRID_COMP_BROADCOM | PRID_IMP_BCM3302)) {
+ cm = read_c0_diag();
+ /* Enable icache */
+ cm |= (1 << 31);
+ /* Enable dcache */
+ cm |= (1 << 30);
+ write_c0_diag(cm);
+ }
+}
+
+static void (*change_cachability)(u32);
+#endif
+
static inline void coherency_setup(void)
{
+#if defined(CONFIG_BCM4310)
+ change_cachability = (void (*)(u32)) KSEG1ADDR((unsigned long)(_change_cachability));
+ change_cachability(CONF_CM_DEFAULT);
+#else
change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT);
+#endif
/*
* c0_status.cu=0 specifies that updates by the sc instruction use

View File

@@ -1,26 +0,0 @@
--- linux-mips-cvs/include/asm-mips/bootinfo.h 2005-01-31 12:59:49.000000000 +0100
+++ linux-broadcom/include/asm-mips/bootinfo.h 2005-01-31 13:13:14.000000000 +0100
@@ -37,6 +37,7 @@
#define MACH_GROUP_HP_LJ 20 /* Hewlett Packard LaserJet */
#define MACH_GROUP_LASAT 21
#define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
+#define MACH_GROUP_BRCM 23 /* Broadcom */
/*
* Valid machtype values for group unknown (low order halfword of mips_machtype)
@@ -197,6 +198,15 @@
#define MACH_TANBAC_TB0229 7 /* TANBAC TB0229 (VR4131DIMM) */
/*
+ * Valid machtypes for group Broadcom
+ */
+#define MACH_BCM93725 0
+#define MACH_BCM93725_VJ 1
+#define MACH_BCM93730 2
+#define MACH_BCM947XX 3
+#define MACH_BCM933XX 4
+
+/*
* Valid machtype for group TITAN
*/
#define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */

View File

@@ -1,50 +0,0 @@
--- linux-mips-cvs/include/asm-mips/cpu.h 2004-07-07 20:19:37.000000000 +0200
+++ linux-broadcom/include/asm-mips/cpu.h 2005-01-31 13:13:14.000000000 +0100
@@ -22,6 +22,11 @@
spec.
*/
+#define PRID_COPT_MASK 0xff000000
+#define PRID_COMP_MASK 0x00ff0000
+#define PRID_IMP_MASK 0x0000ff00
+#define PRID_REV_MASK 0x000000ff
+
#define PRID_COMP_LEGACY 0x000000
#define PRID_COMP_MIPS 0x010000
#define PRID_COMP_BROADCOM 0x020000
@@ -58,6 +63,7 @@
#define PRID_IMP_RM7000 0x2700
#define PRID_IMP_NEVADA 0x2800 /* RM5260 ??? */
#define PRID_IMP_RM9000 0x3400
+#define PRID_IMP_BCM4710 0x4000
#define PRID_IMP_R5432 0x5400
#define PRID_IMP_R5500 0x5500
#define PRID_IMP_4KC 0x8000
@@ -66,10 +72,16 @@
#define PRID_IMP_4KEC 0x8400
#define PRID_IMP_4KSC 0x8600
#define PRID_IMP_25KF 0x8800
+#define PRID_IMP_BCM3302 0x9000
+#define PRID_IMP_BCM3303 0x9100
#define PRID_IMP_24K 0x9300
#define PRID_IMP_UNKNOWN 0xff00
+#define BCM330X(id) \
+ (((id & (PRID_COMP_MASK | PRID_IMP_MASK)) == (PRID_COMP_BROADCOM | PRID_IMP_BCM3302)) \
+ || ((id & (PRID_COMP_MASK | PRID_IMP_MASK)) == (PRID_COMP_BROADCOM | PRID_IMP_BCM3303)))
+
/*
* These are the PRID's for when 23:16 == PRID_COMP_SIBYTE
*/
@@ -174,7 +186,9 @@
#define CPU_AU1550 57
#define CPU_24K 58
#define CPU_AU1200 59
-#define CPU_LAST 59
+#define CPU_BCM4710 60
+#define CPU_BCM3302 61
+#define CPU_LAST 61
/*
* ISA Level encodings

View File

@@ -1,24 +0,0 @@
--- linux-mips-cvs/include/asm-mips/serial.h 2004-08-20 00:33:33.000000000 +0200
+++ linux-broadcom/include/asm-mips/serial.h 2005-01-31 13:13:14.000000000 +0100
@@ -223,6 +223,13 @@
#define TXX927_SERIAL_PORT_DEFNS
#endif
+#ifdef CONFIG_BCM947XX
+/* reserve 4 ports to be configured at runtime */
+#define BCM947XX_SERIAL_PORT_DEFNS { 0, }, { 0, }, { 0, }, { 0, },
+#else
+#define BCM947XX_SERIAL_PORT_DEFNS
+#endif
+
#ifdef CONFIG_HAVE_STD_PC_SERIAL_PORT
#define STD_SERIAL_PORT_DEFNS \
/* UART CLK PORT IRQ FLAGS */ \
@@ -470,6 +477,7 @@
#define SERIAL_PORT_DFNS \
ATLAS_SERIAL_PORT_DEFNS \
AU1000_SERIAL_PORT_DEFNS \
+ BCM947XX_SERIAL_PORT_DEFNS \
COBALT_SERIAL_PORT_DEFNS \
DDB5477_SERIAL_PORT_DEFNS \
EV96100_SERIAL_PORT_DEFNS \

View File

@@ -1,16 +0,0 @@
--- linux-mips-cvs/init/do_mounts.c 2005-01-20 03:19:24.000000000 +0100
+++ linux-broadcom/init/do_mounts.c 2005-01-31 13:13:14.000000000 +0100
@@ -253,7 +253,13 @@
{ "ftlb", 0x2c08 },
{ "ftlc", 0x2c10 },
{ "ftld", 0x2c18 },
+#if defined(CONFIG_MTD_BLOCK) || defined(CONFIG_MTD_BLOCK_RO)
{ "mtdblock", 0x1f00 },
+ { "mtdblock0",0x1f00 },
+ { "mtdblock1",0x1f01 },
+ { "mtdblock2",0x1f02 },
+ { "mtdblock3",0x1f03 },
+#endif
{ "nb", 0x2b00 },
{ NULL, 0 }
};

View File

@@ -1,28 +0,0 @@
--- linux-mips-cvs-21012005/arch/mips/Makefile 2004-11-18 05:16:52.000000000 +0100
+++ linux-broadcom/arch/mips/Makefile 2005-01-24 02:56:02.000000000 +0100
@@ -71,13 +74,13 @@
set_gccflags = $(shell \
while :; do \
cpu=$(1); isa=-$(2); \
- for gcc_opt in -march= -mcpu=; do \
+ for gcc_opt in -march= -mtune=; do \
$(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
-xc /dev/null > /dev/null 2>&1 && \
break 2; \
done; \
cpu=$(3); isa=-$(4); \
- for gcc_opt in -march= -mcpu=; do \
+ for gcc_opt in -march= -mtune=; do \
$(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
-xc /dev/null > /dev/null 2>&1 && \
break 2; \
@@ -92,7 +95,7 @@
fi; \
gas_abi=-Wa,-32; gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
while :; do \
- for gas_opt in -Wa,-march= -Wa,-mcpu=; do \
+ for gas_opt in -Wa,-march= -Wa,-mtune=; do \
$(CC) $$gas_abi $$gas_opt$$cpu $$gas_isa -Wa,-Z -c \
-o /dev/null -xassembler /dev/null > /dev/null 2>&1 && \
break 2; \

View File

@@ -1,28 +0,0 @@
--- linux-mips-cvs-21012005/include/linux/netdevice.h 2004-11-19 01:28:51.000000000 +0100
+++ linux-broadcom/include/linux/netdevice.h 2005-01-26 19:51:37.000000000 +0100
@@ -297,7 +297,10 @@
* See <net/iw_handler.h> for details. Jean II */
struct iw_handler_def * wireless_handlers;
+#ifndef CONFIG_BCM4710
struct ethtool_ops *ethtool_ops;
+#endif
+
/*
* This marks the end of the "visible" part of the structure. All
@@ -353,7 +356,14 @@
struct Qdisc *qdisc;
struct Qdisc *qdisc_sleeping;
struct Qdisc *qdisc_ingress;
+ /*
+ * this is needed for the wlan driver binary blob from linksys
+ */
+#ifdef CONFIG_BCM4710
+ struct Qdisc *qdisc_list;
+#else
struct list_head qdisc_list;
+#endif
unsigned long tx_queue_len; /* Max frames per queue allowed */
/* hard_start_xmit synchronizer */

View File

@@ -1,24 +0,0 @@
--- linux-mips-cvs-21012005/include/linux/skbuff.h 2005-01-31 12:56:47.000000000 +0100
+++ linux-broadcom/include/linux/skbuff.h 2005-01-31 12:55:24.000000000 +0100
@@ -135,10 +135,6 @@
struct sock *sk; /* Socket we are owned by */
struct timeval stamp; /* Time we arrived */
struct net_device *dev; /* Device we arrived on/are leaving by */
- struct net_device *real_dev; /* For support of point to point protocols
- (e.g. 802.3ad) over bonding, we must save the
- physical device that got the packet before
- replacing skb->dev with the virtual device. */
/* Transport layer header */
union
@@ -219,6 +215,10 @@
#ifdef CONFIG_NET_SCHED
__u32 tc_index; /* traffic control index */
#endif
+ struct net_device *real_dev; /* For support of point to point protocols
+ (e.g. 802.3ad) over bonding, we must save the
+ physical device that got the packet before
+ replacing skb->dev with the virtual device. */
};
#ifdef __KERNEL__

View File

@@ -1,28 +0,0 @@
--- linux-mips-cvs-21012005/net/core/Makefile 2004-11-19 01:28:53.000000000 +0100
+++ linux-broadcom/net/core/Makefile 2005-01-26 15:56:36.000000000 +0100
@@ -9,7 +9,11 @@
O_TARGET := core.o
+ifeq ($(CONFIG_BCM4710),y)
+export-objs := netfilter.o profile.o neighbour.o
+else
export-objs := netfilter.o profile.o ethtool.o neighbour.o
+endif
obj-y := sock.o skbuff.o iovec.o datagram.o scm.o
@@ -21,8 +25,13 @@
obj-$(CONFIG_FILTER) += filter.o
+ifeq ($(CONFIG_BCM4710),y)
+obj-$(CONFIG_NET) += dev.o dev_mcast.o dst.o neighbour.o \
+ rtnetlink.o utils.o
+else
obj-$(CONFIG_NET) += dev.o ethtool.o dev_mcast.o dst.o neighbour.o \
rtnetlink.o utils.o
+endif
obj-$(CONFIG_NETFILTER) += netfilter.o
obj-$(CONFIG_NET_DIVERT) += dv.o

View File

@@ -1,28 +0,0 @@
--- linux-2.4.30/net/core/dev.c 2005-04-04 05:42:20.000000000 +0400
+++ linux/net/core/dev.c 2005-05-10 14:49:27.809927172 +0400
@@ -2216,6 +2220,9 @@
cmd == SIOCBONDSLAVEINFOQUERY ||
cmd == SIOCBONDINFOQUERY ||
cmd == SIOCBONDCHANGEACTIVE ||
+#ifdef CONFIG_BCM4710
+ cmd == SIOCETHTOOL ||
+#endif
cmd == SIOCGMIIPHY ||
cmd == SIOCGMIIREG ||
cmd == SIOCSMIIREG ||
@@ -2312,6 +2319,7 @@
return ret;
case SIOCETHTOOL:
+#ifndef CONFIG_BCM4710
dev_load(ifr.ifr_name);
rtnl_lock();
ret = dev_ethtool(&ifr);
@@ -2324,6 +2332,7 @@
ret = -EFAULT;
}
return ret;
+#endif
/*
* These ioctl calls:

View File

@@ -1,119 +0,0 @@
--- linux-2.4.30/net/sched/sch_api.c 2004-11-17 12:54:22.000000000 +0100
+++ linux-2.4.30-wl/net/sched/sch_api.c 2005-04-24 18:56:03.000000000 +0200
@@ -194,11 +194,12 @@
{
struct Qdisc *q;
- list_for_each_entry(q, &dev->qdisc_list, list) {
+ for (q = dev->qdisc_list; q; q = q->next) {
if (q->handle == handle)
return q;
}
return NULL;
+
}
struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
@@ -371,8 +372,6 @@
unsigned long cl = cops->get(parent, classid);
if (cl) {
err = cops->graft(parent, cl, new, old);
- if (new)
- new->parent = classid;
cops->put(parent, cl);
}
}
@@ -427,7 +426,6 @@
memset(sch, 0, size);
- INIT_LIST_HEAD(&sch->list);
skb_queue_head_init(&sch->q);
if (handle == TC_H_INGRESS)
@@ -453,7 +451,8 @@
if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS-1])) == 0) {
write_lock(&qdisc_tree_lock);
- list_add_tail(&sch->list, &dev->qdisc_list);
+ sch->next = dev->qdisc_list;
+ dev->qdisc_list = sch;
write_unlock(&qdisc_tree_lock);
#ifdef CONFIG_NET_ESTIMATOR
if (tca[TCA_RATE-1])
@@ -808,19 +807,16 @@
if (idx > s_idx)
s_q_idx = 0;
read_lock(&qdisc_tree_lock);
- q_idx = 0;
- list_for_each_entry(q, &dev->qdisc_list, list) {
- if (q_idx < s_q_idx) {
- q_idx++;
- continue;
- }
- if (tc_fill_qdisc(skb, q, q->parent, NETLINK_CB(cb->skb).pid,
- cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) {
- read_unlock(&qdisc_tree_lock);
- goto done;
- }
- q_idx++;
- }
+ for (q = dev->qdisc_list, q_idx = 0; q;
+ q = q->next, q_idx++) {
+ if (q_idx < s_q_idx)
+ continue;
+ if (tc_fill_qdisc(skb, q, 0, NETLINK_CB(cb->skb).pid,
+ cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) {
+ read_unlock(&qdisc_tree_lock);
+ goto done;
+ }
+ }
read_unlock(&qdisc_tree_lock);
}
@@ -1033,27 +1029,24 @@
t = 0;
read_lock(&qdisc_tree_lock);
- list_for_each_entry(q, &dev->qdisc_list, list) {
- if (t < s_t || !q->ops->cl_ops ||
- (tcm->tcm_parent &&
- TC_H_MAJ(tcm->tcm_parent) != q->handle)) {
- t++;
- continue;
- }
- if (t > s_t)
- memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0]));
- arg.w.fn = qdisc_class_dump;
- arg.skb = skb;
- arg.cb = cb;
- arg.w.stop = 0;
- arg.w.skip = cb->args[1];
- arg.w.count = 0;
- q->ops->cl_ops->walk(q, &arg.w);
- cb->args[1] = arg.w.count;
- if (arg.w.stop)
- break;
- t++;
- }
+ for (q=dev->qdisc_list, t=0; q; q = q->next, t++) {
+ if (t < s_t) continue;
+ if (!q->ops->cl_ops) continue;
+ if (tcm->tcm_parent && TC_H_MAJ(tcm->tcm_parent) != q->handle)
+ continue;
+ if (t > s_t)
+ memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0]));
+ arg.w.fn = qdisc_class_dump;
+ arg.skb = skb;
+ arg.cb = cb;
+ arg.w.stop = 0;
+ arg.w.skip = cb->args[1];
+ arg.w.count = 0;
+ q->ops->cl_ops->walk(q, &arg.w);
+ cb->args[1] = arg.w.count;
+ if (arg.w.stop)
+ break;
+ }
read_unlock(&qdisc_tree_lock);
cb->args[0] = t;

View File

@@ -1,64 +0,0 @@
--- linux-2.4.30/net/sched/sch_generic.c 2004-11-17 12:54:22.000000000 +0100
+++ linux-2.4.30-wl/net/sched/sch_generic.c 2005-04-24 18:09:38.000000000 +0200
@@ -392,7 +392,6 @@
return NULL;
memset(sch, 0, size);
- INIT_LIST_HEAD(&sch->list);
skb_queue_head_init(&sch->q);
sch->ops = ops;
sch->enqueue = ops->enqueue;
@@ -422,11 +421,22 @@
void qdisc_destroy(struct Qdisc *qdisc)
{
struct Qdisc_ops *ops = qdisc->ops;
+ struct net_device *dev;
if (qdisc->flags&TCQ_F_BUILTIN ||
!atomic_dec_and_test(&qdisc->refcnt))
return;
- list_del(&qdisc->list);
+
+ dev = qdisc->dev;
+ if (dev) {
+ struct Qdisc *q, **qp;
+ for (qp = &qdisc->dev->qdisc_list; (q=*qp) != NULL; qp = &q->next) {
+ if (q == qdisc) {
+ *qp = q->next;
+ break;
+ }
+ }
+ }
#ifdef CONFIG_NET_ESTIMATOR
qdisc_kill_estimator(&qdisc->stats);
#endif
@@ -455,9 +465,9 @@
return;
}
write_lock(&qdisc_tree_lock);
- list_add_tail(&qdisc->list, &dev->qdisc_list);
+ qdisc->next = dev->qdisc_list;
+ dev->qdisc_list = qdisc;
write_unlock(&qdisc_tree_lock);
-
} else {
qdisc = &noqueue_qdisc;
}
@@ -501,7 +511,7 @@
dev->qdisc = &noop_qdisc;
spin_unlock_bh(&dev->queue_lock);
dev->qdisc_sleeping = &noop_qdisc;
- INIT_LIST_HEAD(&dev->qdisc_list);
+ dev->qdisc_list = NULL;
write_unlock(&qdisc_tree_lock);
dev_watchdog_init(dev);
@@ -523,7 +533,7 @@
qdisc_destroy(qdisc);
}
#endif
- BUG_TRAP(list_empty(&dev->qdisc_list));
+ BUG_TRAP(dev->qdisc_list == NULL);
BUG_TRAP(!timer_pending(&dev->watchdog_timer));
spin_unlock_bh(&dev->queue_lock);
write_unlock(&qdisc_tree_lock);

View File

@@ -1,25 +0,0 @@
--- linux-2.4.30/include/net/pkt_sched.h 2004-11-17 12:54:22.000000000 +0100
+++ linux-2.4.30-wl/include/net/pkt_sched.h 2005-04-24 18:32:48.000000000 +0200
@@ -59,7 +59,7 @@
int (*enqueue)(struct sk_buff *, struct Qdisc *);
struct sk_buff * (*dequeue)(struct Qdisc *);
int (*requeue)(struct sk_buff *, struct Qdisc *);
- unsigned int (*drop)(struct Qdisc *);
+ int (*drop)(struct Qdisc *);
int (*init)(struct Qdisc *, struct rtattr *arg);
void (*reset)(struct Qdisc *);
@@ -80,12 +80,11 @@
#define TCQ_F_THROTTLED 2
#define TCQ_F_INGRESS 4
struct Qdisc_ops *ops;
+ struct Qdisc *next;
u32 handle;
- u32 parent;
atomic_t refcnt;
struct sk_buff_head q;
struct net_device *dev;
- struct list_head list;
struct tc_stats stats;
int (*reshape_fail)(struct sk_buff *skb, struct Qdisc *q);

View File

@@ -1,23 +0,0 @@
diff -urN linux-2.4.30.old/fs/hfsplus/super.c linux-2.4.30.dev/fs/hfsplus/super.c
--- linux-2.4.30.old/fs/hfsplus/super.c 2003-08-25 13:44:43.000000000 +0200
+++ linux-2.4.30.dev/fs/hfsplus/super.c 2005-04-27 19:54:40.000000000 +0200
@@ -240,8 +240,7 @@
if (!(*flags & MS_RDONLY)) {
struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr;
- if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_INCNSTNT)) ||
- !(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
+ if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
printk("HFS+-fs warning: Filesystem was not cleanly unmounted, "
"running fsck.hfsplus is recommended. leaving read-only.\n");
sb->s_flags |= MS_RDONLY;
@@ -343,8 +342,7 @@
/* Set up operations so we can load metadata */
sb->s_op = &hfsplus_sops;
- if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_INCNSTNT)) ||
- !(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
+ if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
if (!silent)
printk("HFS+-fs warning: Filesystem was not cleanly unmounted, "
"running fsck.hfsplus is recommended. mounting read-only.\n");

View File

@@ -1,10 +0,0 @@
--- linux-2.4.30.old/arch/mips/ld.script.in 2005-04-28 23:22:23.513764016 +0400
+++ linux-2.4.30/arch/mips/ld.script.in 2005-04-28 23:22:36.329673152 +0400
@@ -9,6 +9,7 @@
{
_ftext = . ;
*(.text)
+ *(.fixup)
*(.rodata)
*(.rodata.*)
*(.rodata1)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,720 +0,0 @@
diff -urN linux-2.4.29.old/include/linux/netfilter_ipv4/ipt_ipp2p.h linux-2.4.29/include/linux/netfilter_ipv4/ipt_ipp2p.h
--- linux-2.4.29.old/include/linux/netfilter_ipv4/ipt_ipp2p.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.29/include/linux/netfilter_ipv4/ipt_ipp2p.h 2005-03-12 00:44:17.000000000 +0100
@@ -0,0 +1,29 @@
+#ifndef __IPT_IPP2P_H
+#define __IPT_IPP2P_H
+#define IPP2P_VERSION "0.7.4"
+
+struct ipt_p2p_info {
+ int cmd;
+ int debug;
+};
+
+#endif //__IPT_IPP2P_H
+
+#define SHORT_HAND_IPP2P 1 /* --ipp2p switch*/
+#define SHORT_HAND_DATA 4 /* --ipp2p-data switch*/
+#define SHORT_HAND_NONE 5 /* no short hand*/
+
+#define IPP2P_EDK 2
+#define IPP2P_DATA_KAZAA 8
+#define IPP2P_DATA_EDK 16
+#define IPP2P_DATA_DC 32
+#define IPP2P_DC 64
+#define IPP2P_DATA_GNU 128
+#define IPP2P_GNU 256
+#define IPP2P_KAZAA 512
+#define IPP2P_BIT 1024
+#define IPP2P_APPLE 2048
+#define IPP2P_SOUL 4096
+#define IPP2P_WINMX 8192
+#define IPP2P_ARES 16384
+
diff -urN linux-2.4.29.old/net/ipv4/netfilter/Config.in linux-2.4.29/net/ipv4/netfilter/Config.in
--- linux-2.4.29.old/net/ipv4/netfilter/Config.in 2005-03-12 00:40:38.000000000 +0100
+++ linux-2.4.29/net/ipv4/netfilter/Config.in 2005-03-12 00:42:57.000000000 +0100
@@ -26,6 +26,7 @@
dep_tristate ' TOS match support' CONFIG_IP_NF_MATCH_TOS $CONFIG_IP_NF_IPTABLES
dep_tristate ' recent match support' CONFIG_IP_NF_MATCH_RECENT $CONFIG_IP_NF_IPTABLES
dep_tristate ' ECN match support' CONFIG_IP_NF_MATCH_ECN $CONFIG_IP_NF_IPTABLES
+ dep_tristate ' peer to peer traffic match support' CONFIG_IP_NF_MATCH_IPP2P $CONFIG_IP_NF_IPTABLES
dep_tristate ' DSCP match support' CONFIG_IP_NF_MATCH_DSCP $CONFIG_IP_NF_IPTABLES
diff -urN linux-2.4.29.old/net/ipv4/netfilter/ipt_ipp2p.c linux-2.4.29/net/ipv4/netfilter/ipt_ipp2p.c
--- linux-2.4.29.old/net/ipv4/netfilter/ipt_ipp2p.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.29/net/ipv4/netfilter/ipt_ipp2p.c 2005-03-12 00:44:02.000000000 +0100
@@ -0,0 +1,661 @@
+#if defined(MODVERSIONS)
+#include <linux/modversions.h>
+#endif
+#include <linux/module.h>
+#include <linux/netfilter_ipv4/ip_tables.h>
+#include <linux/version.h>
+#include <linux/netfilter_ipv4/ipt_ipp2p.h>
+//#include "ipt_ipp2p.h"
+#include <net/tcp.h>
+#include <net/udp.h>
+
+#define get_u8(X,O) (*(__u8 *)(X + O))
+#define get_u16(X,O) (*(__u16 *)(X + O))
+#define get_u32(X,O) (*(__u32 *)(X + O))
+
+MODULE_AUTHOR("Eicke Friedrich <ipp2p@ipp2p.org>");
+MODULE_DESCRIPTION("An extension to iptables to identify P2P traffic.");
+MODULE_LICENSE("GPL");
+
+
+/*Search for UDP eDonkey/eMule/Kad commands*/
+int
+udp_search_edk (unsigned char *haystack, int packet_len)
+{
+ unsigned char *t = haystack;
+ t += 8;
+
+ switch (t[0]) {
+ case 0xe3: { /*edonkey*/
+ switch (t[1]) {
+ /* e3 9a + 16Bytes Hash | size == 26 */
+ case 0x9a: if (packet_len == 26) return ((IPP2P_EDK * 100) + 1);
+ /* e3 96 xx yy zz kk | size == 14 | server status request */
+ case 0x96: if (packet_len == 14) return ((IPP2P_EDK * 100) + 2);
+ /* e3 a2 | size == 10 or 14 <-- recheck*/
+ }
+ }
+
+ case 0xc5: { /*emule*/
+ switch (t[1]) {
+ /* c5 91 xx yy | size == 12 (8+4) | xx != 0x00 -- xx yy queue rating */
+ case 0x91: if ((packet_len == 12) && (t[2] != 0x00)) return ((IPP2P_EDK * 100) + 3);
+ /* c5 90 xx .. yy | size == 26 (8+2+16) | xx .. yy == hash -- file ping */
+ case 0x90: if ((packet_len == 26) && (t[2] != 0x00)) return ((IPP2P_EDK * 100) + 4);
+ /* c5 92 | size == 10 (8+2) -- file not found */
+ case 0x92: if (packet_len == 10) return ((IPP2P_EDK * 100) + 5);
+ /* c5 93 | size == 10 (8+2) -- queue full */
+ case 0x93: if (packet_len == 10) return ((IPP2P_EDK * 100) + 6);
+ }
+ }
+
+ case 0xe4: { /*kad*/
+ switch (t[1]) {
+ /* e4 50 | size == 12 */
+ case 0x50: if (packet_len == 12) return ((IPP2P_EDK * 100) + 7);
+ /* e4 58 | size == 14 */
+ case 0x58: if ((packet_len == 14) && (t[2] != 0x00)) return ((IPP2P_EDK * 100) + 8);
+ /* e4 59 | size == 10 */
+ case 0x59: if (packet_len == 10) return ((IPP2P_EDK * 100) + 9);
+ /* e4 30 .. | t[18] == 0x01 | size > 26 | --> search */
+ case 0x30: if ((packet_len > 26) && (t[18] == 0x01)) return ((IPP2P_EDK * 100) + 10);
+ /* e4 28 .. 00 | t[68] == 0x00 | size > 76 */
+ case 0x28: if ((packet_len > 76) && (t[68] == 0x00)) return ((IPP2P_EDK * 100) + 11);
+ /* e4 20 .. | size == 43 */
+ case 0x20: if ((packet_len == 43) && (t[2] != 0x00) && (t[34] != 0x00)) return ((IPP2P_EDK * 100) + 12);
+ /* e4 00 .. 00 | size == 35 ? */
+ case 0x00: if ((packet_len == 35) && (t[26] == 0x00)) return ((IPP2P_EDK * 100) + 13);
+ /* e4 10 .. 00 | size == 35 ? */
+ case 0x10: if ((packet_len == 35) && (t[26] == 0x00)) return ((IPP2P_EDK * 100) + 14);
+ /* e4 18 .. 00 | size == 35 ? */
+ case 0x18: if ((packet_len == 35) && (t[26] == 0x00)) return ((IPP2P_EDK * 100) + 15);
+ /* e4 40 .. | t[18] == 0x01 | t[19] == 0x00 | size > 40 */
+ case 0x40: if ((packet_len > 40) && (t[18] == 0x01) && (t[19] == 0x00)) return ((IPP2P_EDK * 100) + 16);
+ }
+ }
+
+ default: return 0;
+ } /* end of switch (t[0]) */
+}/*udp_search_edk*/
+
+
+/*Search for UDP Gnutella commands*/
+int
+udp_search_gnu (unsigned char *haystack, int packet_len)
+{
+ unsigned char *t = haystack;
+ t += 8;
+
+ if (memcmp(t, "GND", 3) == 0) return ((IPP2P_GNU * 100) + 1);
+ if (memcmp(t, "GNUTELLA ", 9) == 0) return ((IPP2P_GNU * 100) + 2);
+ return 0;
+}/*udp_search_gnu*/
+
+
+/*Search for UDP KaZaA commands*/
+int
+udp_search_kazaa (unsigned char *haystack, int packet_len)
+{
+ unsigned char *t = haystack;
+
+ if (t[packet_len-1] == 0x00){
+ t += (packet_len - 6);
+ if (memcmp(t, "KaZaA", 5) == 0) return (IPP2P_KAZAA * 100);
+ }
+ return 0;
+}/*udp_search_kazaa*/
+
+
+/*Search for UDP BitTorrent commands*/
+int
+udp_search_bit (unsigned char *haystack, int packet_len)
+{
+ unsigned char *t = haystack;
+
+ /* packet_len has to be 24 */
+ if (packet_len != 24) return 0;
+
+ t += 8;
+
+ /* ^ 00 00 04 17 27 10 19 80 */
+ if ((ntohl(get_u32(t, 0)) == 0x00000417) && (ntohl(get_u32(t, 4)) == 0x27101980)) return (IPP2P_BIT * 100);
+
+ return 0;
+}/*udp_search_bit*/
+
+
+
+/*Search for Ares commands*/
+int
+search_ares (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+ t += head_len;
+
+ if ((packet_len - head_len) == 6){ /* possible connect command*/
+ if ((t[0] == 0x03) && (t[1] == 0x00) && (t[2] == 0x5a) && (t[3] == 0x04) && (t[4] == 0x03) && (t[5] == 0x05))
+ return ((IPP2P_ARES * 100) + 1); /* found connect packet: 03 00 5a 04 03 05 */
+ }
+ if ((packet_len - head_len) == 60){ /* possible download command*/
+ if ((t[59] == 0x0a) && (t[58] == 0x0a)){
+ if (memcmp(t, "PUSH SHA1:", 10) == 0) /* found download command */
+ return ((IPP2P_ARES * 100) + 2);
+ }
+ }
+ return 0;
+} /*search_ares*/
+
+
+/*Search for SoulSeek commands*/
+int
+search_soul (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+ t += head_len;
+
+ if (get_u16(t, 0) == (packet_len - head_len - 4)){
+ /* xx xx 00 00 yy zz 00 00 .. | xx = sizeof(payload) - 4 */
+ if ((get_u16(t,2) == 0x0000) &&(t[4] != 0x00) && (get_u16(t,6) == 0x0000))
+ return ((IPP2P_SOUL * 100) + 1);
+ } else {
+ /* 00 00 00 00 00 00 00 00 + sizeof(payload) == 8*/
+ if (((packet_len - head_len) == 8) && (get_u32(t, 0) == 0x00000000) && (get_u32(t, 4) == 0x00000000))
+ return ((IPP2P_SOUL * 100) + 2);
+ }
+
+ /* 01 xx 00 00 00 yy .. zz 00 00 00 .. | xx == sizeof(nick) | yy .. zz == nick */
+ if ((t[0] == 0x01) && (t[2] == 0x00) && (get_u16(t,3) == 0x0000) && ((packet_len - head_len) > ((get_u8(t,1))+6)) &&
+ (t[(get_u8(t,1))+4] != 0x00) && (t[(get_u8(t,1))+5] == 0x01) && (t[(get_u8(t,1))+6] == 0x00))
+ return ((IPP2P_SOUL * 100) + 3);
+ return 0;
+}
+
+
+/*Search for WinMX commands*/
+int
+search_winmx (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+ int c;
+ t += head_len;
+
+ if (((packet_len - head_len) == 4) && (memcmp(t, "SEND", 4) == 0)) return ((IPP2P_WINMX * 100) + 1);
+ if (((packet_len - head_len) == 3) && (memcmp(t, "GET", 3) == 0)) return ((IPP2P_WINMX * 100) + 2);
+ if (packet_len < (head_len + 10)) return 0;
+
+ if ((memcmp(t, "SEND", 4) == 0) || (memcmp(t, "GET", 3) == 0)){
+ c = head_len + 4;
+ t += 4;
+ while (c < packet_len - 5) {
+ if ((t[0] == 0x20) && (t[1] == 0x22)){
+ c += 2;
+ t += 2;
+ while (c < packet_len - 2) {
+ if ((t[0] == 0x22) && (t[1] == 0x20)) return ((IPP2P_WINMX * 100) + 3);
+ t++;
+ c++;
+ }
+ }
+ t++;
+ c++;
+ }
+ }
+ return 0;
+} /*search_winmx*/
+
+
+/*Search for appleJuice commands*/
+int
+search_apple (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+ t += head_len;
+
+ if ((memcmp(t, "ajprot", 6) == 0) && (t[6] == 0x0d) && (t[7] == 0x0a)) return (IPP2P_APPLE * 100);
+
+ return 0;
+}
+
+
+/*Search for BitTorrent commands*/
+int
+search_bittorrent (unsigned char *haystack, int packet_len, int head_len)
+{
+
+ unsigned char *t = haystack;
+ if (*(haystack+head_len) != 0x13) return 0; /*Bail out of first byte != 0x13*/
+
+ t += head_len + 1;
+
+ if (memcmp(t, "BitTorrent protocol", 19) == 0) return (IPP2P_BIT * 100);
+ return 0;
+}
+
+
+
+/*check for Kazaa get command*/
+int
+search_kazaa (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+
+ if (!((*(haystack + packet_len - 2) == 0x0d) && (*(haystack + packet_len - 1) == 0x0a))) return 0;
+
+ t += head_len;
+ if (memcmp(t, "GET /.hash=", 11) == 0)
+ return (IPP2P_DATA_KAZAA * 100);
+ else
+ return 0;
+}
+
+
+/*check for gnutella get command*/
+int
+search_gnu (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+
+ if (!((*(haystack + packet_len - 2) == 0x0d) && (*(haystack + packet_len - 1) == 0x0a))) return 0;
+
+ t += head_len;
+ if (memcmp(t, "GET /get/", 9) == 0) return ((IPP2P_DATA_GNU * 100) + 1);
+ if (memcmp(t, "GET /uri-res/", 13) == 0) return ((IPP2P_DATA_GNU * 100) + 2);
+
+ return 0;
+}
+
+
+/*check for gnutella get commands and other typical data*/
+int
+search_all_gnu (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+ int c;
+
+ if (!((*(haystack + packet_len - 2) == 0x0d) && (*(haystack + packet_len - 1) == 0x0a))) return 0;
+
+ t += head_len;
+
+ if (memcmp(t, "GNUTELLA CONNECT/", 17) == 0) return ((IPP2P_GNU * 100) + 1);
+ if (memcmp(t, "GNUTELLA/", 9) == 0) return ((IPP2P_GNU * 100) + 2);
+
+ if ((memcmp(t, "GET /get/", 9) == 0) || (memcmp(t, "GET /uri-res/", 13) == 0))
+ {
+ c = head_len + 8;
+ t += 8;
+ while (c < packet_len - 22) {
+ if ((t[0] == 0x0d) && (t[1] == 0x0a)) {
+ t += 2;
+ c += 2;
+ if ((memcmp(t, "X-Gnutella-", 11) == 0) || (memcmp(t, "X-Queue:", 8) == 0)) return ((IPP2P_GNU * 100) + 3);
+ } else {
+ t++;
+ c++;
+ }
+ }
+ }
+ return 0;
+}
+
+
+/*check for KaZaA download commands and other typical data*/
+int
+search_all_kazaa (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+ int c;
+
+ if (!((*(haystack + packet_len - 2) == 0x0d) && (*(haystack + packet_len - 1) == 0x0a))) return 0;
+
+ t += head_len;
+ if (memcmp(t, "GIVE ", 5) == 0) return ((IPP2P_KAZAA * 100) + 1);
+
+ if (memcmp(t, "GET /", 5) == 0) {
+ c = head_len + 8;
+ t += 8;
+ while (c < packet_len - 22) {
+ if ((t[0] == 0x0d) && (t[1] == 0x0a)) {
+ t += 2;
+ c += 2;
+ if ( memcmp(t, "X-Kazaa-Username: ", 18) == 0 ) return ((IPP2P_KAZAA * 100) + 2);
+ if ( memcmp(t, "User-Agent: PeerEnabler/", 24) == 0 ) return ((IPP2P_KAZAA * 100) + 3);
+ } else {
+ t++;
+ c++;
+ }
+ }
+ }
+
+ return 0;
+}
+
+/*fast check for edonkey file segment transfer command*/
+int
+search_edk (unsigned char *haystack, int packet_len, int head_len)
+{
+ if (*(haystack+head_len) != 0xe3)
+ return 0;
+ else {
+ if (*(haystack+head_len+5) == 0x47)
+ return (IPP2P_DATA_EDK * 100);
+ else
+ return 0;
+ }
+}
+
+
+
+/*intensive but slower search for some edonkey packets including size-check*/
+int
+search_all_edk (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+ int cmd;
+
+ if (*(haystack+head_len) == 0xd4) {
+ t += head_len;
+ cmd = get_u16(t, 1);
+ if (cmd == (packet_len - head_len - 5)) {
+ switch (t[5]) {
+ case 0x82: return ((IPP2P_EDK * 100) + 42);
+ case 0x15: return ((IPP2P_EDK * 100) + 43);
+ default: return 0;
+ }
+ }
+ return 0;
+ }
+
+
+ if (*(haystack+head_len) == 0xc5) { /*search for additional eMule packets*/
+ t += head_len;
+ cmd = get_u16(t, 1);
+
+ if (cmd == (packet_len - head_len - 5)) {
+ switch (t[5]) {
+ case 0x01: return ((IPP2P_EDK * 100) + 30);
+ case 0x02: return ((IPP2P_EDK * 100) + 31);
+ case 0x60: return ((IPP2P_EDK * 100) + 32);
+ case 0x81: return ((IPP2P_EDK * 100) + 33);
+ case 0x82: return ((IPP2P_EDK * 100) + 34);
+ case 0x85: return ((IPP2P_EDK * 100) + 35);
+ case 0x86: return ((IPP2P_EDK * 100) + 36);
+ case 0x87: return ((IPP2P_EDK * 100) + 37);
+ case 0x40: return ((IPP2P_EDK * 100) + 38);
+ case 0x92: return ((IPP2P_EDK * 100) + 39);
+ case 0x93: return ((IPP2P_EDK * 100) + 40);
+ case 0x12: return ((IPP2P_EDK * 100) + 41);
+ default: return 0;
+ }
+ }
+
+ return 0;
+ }
+
+
+ if (*(haystack+head_len) != 0xe3)
+ return 0;
+ else {
+ t += head_len;
+ cmd = get_u16(t, 1);
+ if (cmd == (packet_len - head_len - 5)) {
+ switch (t[5]) {
+ case 0x01: return ((IPP2P_EDK * 100) + 1); /*Client: hello or Server:hello*/
+ case 0x50: return ((IPP2P_EDK * 100) + 2); /*Client: file status*/
+ case 0x16: return ((IPP2P_EDK * 100) + 3); /*Client: search*/
+ case 0x58: return ((IPP2P_EDK * 100) + 4); /*Client: file request*/
+ case 0x48: return ((IPP2P_EDK * 100) + 5); /*???*/
+ case 0x54: return ((IPP2P_EDK * 100) + 6); /*???*/
+ case 0x47: return ((IPP2P_EDK * 100) + 7); /*Client: file segment request*/
+ case 0x46: return ((IPP2P_EDK * 100) + 8); /*Client: download segment*/
+ case 0x4c: return ((IPP2P_EDK * 100) + 9); /*Client: Hello-Answer*/
+ case 0x4f: return ((IPP2P_EDK * 100) + 10); /*Client: file status request*/
+ case 0x59: return ((IPP2P_EDK * 100) + 11); /*Client: file request answer*/
+ case 0x65: return ((IPP2P_EDK * 100) + 12); /*Client: ???*/
+ case 0x66: return ((IPP2P_EDK * 100) + 13); /*Client: ???*/
+ case 0x51: return ((IPP2P_EDK * 100) + 14); /*Client: ???*/
+ case 0x52: return ((IPP2P_EDK * 100) + 15); /*Client: ???*/
+ case 0x4d: return ((IPP2P_EDK * 100) + 16); /*Client: ???*/
+ case 0x5c: return ((IPP2P_EDK * 100) + 17); /*Client: ???*/
+ case 0x38: return ((IPP2P_EDK * 100) + 18); /*Client: ???*/
+ case 0x69: return ((IPP2P_EDK * 100) + 19); /*Client: ???*/
+ case 0x19: return ((IPP2P_EDK * 100) + 20); /*Client: ???*/
+ case 0x42: return ((IPP2P_EDK * 100) + 21); /*Client: ???*/
+ case 0x34: return ((IPP2P_EDK * 100) + 22); /*Client: ???*/
+ case 0x94: return ((IPP2P_EDK * 100) + 23); /*Client: ???*/
+ case 0x1c: return ((IPP2P_EDK * 100) + 24); /*Client: ???*/
+ case 0x6a: return ((IPP2P_EDK * 100) + 25); /*Client: ???*/
+ default: return 0;
+ }
+ } else {
+ if (cmd > packet_len - head_len - 5) {
+ if ((t[3] == 0x00) && (t[4] == 0x00)) {
+ if (t[5] == 0x01) return ((IPP2P_EDK * 100) + 26);
+ if (t[5] == 0x4c) return ((IPP2P_EDK * 100) + 27);
+ }
+ return 0;
+
+ } /*non edk packet*/
+ if (t[cmd+5] == 0xe3) return ((IPP2P_EDK * 100) + 28);/*found another edk-command*/
+ if (t[cmd+5] == 0xc5) return ((IPP2P_EDK * 100) + 29);/*found an emule-command*/
+ return 0;
+ }
+ }
+}
+
+
+/*fast check for Direct Connect send command*/
+int
+search_dc (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+
+ if (*(haystack+head_len) != 0x24 )
+ return 0;
+ else {
+ t += head_len + 1;
+ if (memcmp(t, "Send|", 5) == 0)
+ return (IPP2P_DATA_DC * 100);
+ else
+ return 0;
+ }
+
+}
+
+
+/*intensive but slower check for all direct connect packets*/
+int
+search_all_dc (unsigned char *haystack, int packet_len, int head_len)
+{
+ unsigned char *t = haystack;
+
+ if ((*(haystack + head_len) == 0x24) && (*(haystack + packet_len - 1) == 0x7c)) {
+ t += head_len + 1;
+ if (memcmp(t, "Lock ", 5) == 0) return ((IPP2P_DC * 100) + 1); /*hub: hello*/
+ if (memcmp(t, "Key ", 4) == 0) return ((IPP2P_DC * 100) + 2); /*client: hello*/
+ if (memcmp(t, "Hello ", 6) == 0) return ((IPP2P_DC * 100) + 3); /*hub:connected*/
+ if (memcmp(t, "MyNick ", 7) == 0) return ((IPP2P_DC * 100) + 4); /*client-client: hello*/
+ if (memcmp(t, "Search ", 7) == 0) return ((IPP2P_DC * 100) + 5); /*client: search*/
+ if (memcmp(t, "Send", 4) == 0) return ((IPP2P_DC * 100) + 6); /*client: start download*/
+ return 0;
+ } else
+ return 0;
+}
+
+
+static struct {
+ int command;
+ __u8 short_hand; /*for fucntions included in short hands*/
+ int packet_len;
+ int (*function_name) (unsigned char *, int, int);
+} matchlist[] = {
+ {IPP2P_EDK,SHORT_HAND_IPP2P,40, &search_all_edk},
+ {IPP2P_DATA_KAZAA,SHORT_HAND_DATA,200, &search_kazaa},
+ {IPP2P_DATA_EDK,SHORT_HAND_DATA,60, &search_edk},
+ {IPP2P_DATA_DC,SHORT_HAND_DATA,26, &search_dc},
+ {IPP2P_DC,SHORT_HAND_IPP2P,25, search_all_dc},
+ {IPP2P_DATA_GNU,SHORT_HAND_DATA,40, &search_gnu},
+ {IPP2P_GNU,SHORT_HAND_IPP2P,35, &search_all_gnu},
+ {IPP2P_KAZAA,SHORT_HAND_IPP2P,35, &search_all_kazaa},
+ {IPP2P_BIT,SHORT_HAND_NONE,40, &search_bittorrent},
+ {IPP2P_APPLE,SHORT_HAND_NONE,20, &search_apple},
+ {IPP2P_SOUL,SHORT_HAND_NONE,25, &search_soul},
+ {IPP2P_WINMX,SHORT_HAND_NONE,20, &search_winmx},
+ {IPP2P_ARES,SHORT_HAND_NONE,25, &search_ares},
+ {0,0,0,NULL}
+};
+
+
+static struct {
+ int command;
+ __u8 short_hand; /*for fucntions included in short hands*/
+ int packet_len;
+ int (*function_name) (unsigned char *, int);
+} udp_list[] = {
+ {IPP2P_KAZAA,SHORT_HAND_IPP2P,14, &udp_search_kazaa},
+ {IPP2P_BIT,SHORT_HAND_NONE,23, &udp_search_bit},
+ {IPP2P_GNU,SHORT_HAND_IPP2P,11, &udp_search_gnu},
+ {IPP2P_EDK,SHORT_HAND_IPP2P,9, &udp_search_edk},
+ {0,0,0,NULL}
+};
+
+
+static int
+match(const struct sk_buff *skb,
+ const struct net_device *in,
+ const struct net_device *out,
+ const void *matchinfo,
+ int offset,
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ const void *hdr,
+ u_int16_t datalen,
+#endif
+
+ int *hotdrop)
+{
+ const struct ipt_p2p_info *info = matchinfo;
+ unsigned char *haystack;
+ struct iphdr *ip = skb->nh.iph;
+ int p2p_result = 0, i = 0;
+ int head_len;
+ int hlen = ntohs(ip->tot_len)-(ip->ihl*4); /*hlen = packet-data length*/
+
+ /*must not be a fragment*/
+ if (offset) {
+ if (info->debug) printk("IPP2P.match: offset found %i \n",offset);
+ return 0;
+ }
+
+ /*make sure that skb is linear*/
+ if(skb_is_nonlinear(skb)){
+ if (info->debug) printk("IPP2P.match: nonlinear skb found\n");
+ return 0;
+ }
+
+
+ haystack=(char *)ip+(ip->ihl*4); /*haystack = packet data*/
+
+ switch (ip->protocol){
+ case IPPROTO_TCP: /*what to do with a TCP packet*/
+ {
+ struct tcphdr *tcph = (void *) ip + ip->ihl * 4;
+
+ if (tcph->fin) return 0; /*if FIN bit is set bail out*/
+ if (tcph->syn) return 0; /*if SYN bit is set bail out*/
+ if (tcph->rst) return 0; /*if RST bit is set bail out*/
+ head_len = tcph->doff * 4; /*get TCP-Header-Size*/
+ while (matchlist[i].command) {
+ if ((((info->cmd & matchlist[i].command) == matchlist[i].command) ||
+ ((info->cmd & matchlist[i].short_hand) == matchlist[i].short_hand)) &&
+ (hlen > matchlist[i].packet_len)) {
+ p2p_result = matchlist[i].function_name(haystack, hlen, head_len);
+ if (p2p_result)
+ {
+ if (info->debug) printk("IPP2P.debug:TCP-match: %i from: %u.%u.%u.%u:%i to: %u.%u.%u.%u:%i Length: %i\n",
+ p2p_result, NIPQUAD(ip->saddr),ntohs(tcph->source), NIPQUAD(ip->daddr),ntohs(tcph->dest),hlen);
+ return p2p_result;
+ }
+ }
+ i++;
+ }
+ return p2p_result;
+ }
+
+ case IPPROTO_UDP: /*what to do with an UDP packet*/
+ {
+ struct udphdr *udph = (void *) ip + ip->ihl * 4;
+
+ while (udp_list[i].command){
+ if ((((info->cmd & udp_list[i].command) == udp_list[i].command) ||
+ ((info->cmd & udp_list[i].short_hand) == udp_list[i].short_hand)) &&
+ (hlen > udp_list[i].packet_len)) {
+ p2p_result = udp_list[i].function_name(haystack, hlen);
+ if (p2p_result){
+ if (info->debug) printk("IPP2P.debug:UDP-match: %i from: %u.%u.%u.%u:%i to: %u.%u.%u.%u:%i Length: %i\n",
+ p2p_result, NIPQUAD(ip->saddr),ntohs(udph->source), NIPQUAD(ip->daddr),ntohs(udph->dest),hlen);
+ return p2p_result;
+ }
+ }
+ i++;
+ }
+ return p2p_result;
+ }
+
+ default: return 0;
+ }
+}
+
+
+
+static int
+checkentry(const char *tablename,
+ const struct ipt_ip *ip,
+ void *matchinfo,
+ unsigned int matchsize,
+ unsigned int hook_mask)
+{
+ /* Must specify -p tcp */
+/* if (ip->proto != IPPROTO_TCP || (ip->invflags & IPT_INV_PROTO)) {
+ * printk("ipp2p: Only works on TCP packets, use -p tcp\n");
+ * return 0;
+ * }*/
+ return 1;
+}
+
+
+
+
+static struct ipt_match ipp2p_match = {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ { NULL, NULL },
+ "ipp2p",
+ &match,
+ &checkentry,
+ NULL,
+ THIS_MODULE
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ .name = "ipp2p",
+ .match = &match,
+ .checkentry = &checkentry,
+ .me = THIS_MODULE,
+#endif
+};
+
+
+static int __init init(void)
+{
+ printk(KERN_INFO "IPP2P v%s loading\n", IPP2P_VERSION);
+ return ipt_register_match(&ipp2p_match);
+}
+
+static void __exit fini(void)
+{
+ ipt_unregister_match(&ipp2p_match);
+ printk(KERN_INFO "IPP2P v%s unloaded\n", IPP2P_VERSION);
+}
+
+module_init(init);
+module_exit(fini);
+
+
diff -urN linux-2.4.29.old/net/ipv4/netfilter/Makefile linux-2.4.29/net/ipv4/netfilter/Makefile
--- linux-2.4.29.old/net/ipv4/netfilter/Makefile 2005-03-12 00:40:38.000000000 +0100
+++ linux-2.4.29/net/ipv4/netfilter/Makefile 2005-03-12 00:42:57.000000000 +0100
@@ -67,6 +67,7 @@
obj-$(CONFIG_IP_NF_MATCH_LIMIT) += ipt_limit.o
obj-$(CONFIG_IP_NF_MATCH_MARK) += ipt_mark.o
obj-$(CONFIG_IP_NF_MATCH_MAC) += ipt_mac.o
+obj-$(CONFIG_IP_NF_MATCH_IPP2P) += ipt_ipp2p.o
obj-$(CONFIG_IP_NF_MATCH_PKTTYPE) += ipt_pkttype.o
obj-$(CONFIG_IP_NF_MATCH_MULTIPORT) += ipt_multiport.o

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,214 +0,0 @@
diff -Nur linux-2.4.29/arch/mips/kernel/signal.c linux-2.4.29-gcc3.4/arch/mips/kernel/signal.c
--- linux-2.4.29/arch/mips/kernel/signal.c 2005-01-19 15:09:29.000000000 +0100
+++ linux-2.4.29-gcc3.4/arch/mips/kernel/signal.c 2005-03-27 23:09:57.000000000 +0200
@@ -6,8 +6,10 @@
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright (C) 1994 - 1999 Ralf Baechle
* Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 2004 Maciej W. Rozycki
*/
#include <linux/config.h>
+#include <linux/compiler.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
@@ -76,7 +78,9 @@
* Atomically swap in the new signal mask, and wait for a signal.
*/
save_static_function(sys_sigsuspend);
-static_unused int _sys_sigsuspend(struct pt_regs regs)
+static int _sys_sigsuspend(struct pt_regs regs)
+ __asm__("_sys_sigsuspend") __attribute_used__;
+static int _sys_sigsuspend(struct pt_regs regs)
{
sigset_t *uset, saveset, newset;
@@ -102,7 +106,9 @@
}
save_static_function(sys_rt_sigsuspend);
-static_unused int _sys_rt_sigsuspend(struct pt_regs regs)
+static int _sys_rt_sigsuspend(struct pt_regs regs)
+ __asm__("_sys_rt_sigsuspend") __attribute_used__;
+static int _sys_rt_sigsuspend(struct pt_regs regs)
{
sigset_t *unewset, saveset, newset;
size_t sigsetsize;
diff -Nur linux-2.4.29/arch/mips/kernel/syscall.c linux-2.4.29-gcc3.4/arch/mips/kernel/syscall.c
--- linux-2.4.29/arch/mips/kernel/syscall.c 2005-01-19 15:09:29.000000000 +0100
+++ linux-2.4.29-gcc3.4/arch/mips/kernel/syscall.c 2005-03-27 23:09:57.000000000 +0200
@@ -5,6 +5,7 @@
*
* Copyright (C) 1995 - 2000 by Ralf Baechle
* Copyright (C) 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2004 Maciej W. Rozycki
*
* TODO: Implement the compatibility syscalls.
* Don't waste that much memory for empty entries in the syscall
@@ -158,7 +159,9 @@
}
save_static_function(sys_fork);
-static_unused int _sys_fork(struct pt_regs regs)
+static int _sys_fork(struct pt_regs regs)
+ __asm__("_sys_fork") __attribute_used__;
+static int _sys_fork(struct pt_regs regs)
{
int res;
@@ -168,7 +171,9 @@
save_static_function(sys_clone);
-static_unused int _sys_clone(struct pt_regs regs)
+static int _sys_clone(struct pt_regs regs)
+ __asm__("_sys_clone") __attribute_used__;
+static int _sys_clone(struct pt_regs regs)
{
unsigned long clone_flags;
unsigned long newsp;
diff -Nur linux-2.4.29/arch/mips64/kernel/signal.c linux-2.4.29-gcc3.4/arch/mips64/kernel/signal.c
--- linux-2.4.29/arch/mips64/kernel/signal.c 2005-01-19 15:09:32.000000000 +0100
+++ linux-2.4.29-gcc3.4/arch/mips64/kernel/signal.c 2005-03-27 23:09:57.000000000 +0200
@@ -6,8 +6,10 @@
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright (C) 1994 - 2000 Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2004 Maciej W. Rozycki
*/
#include <linux/config.h>
+#include <linux/compiler.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
@@ -75,7 +77,9 @@
* Atomically swap in the new signal mask, and wait for a signal.
*/
save_static_function(sys_rt_sigsuspend);
-static_unused int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
+static int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
+ __asm__("_sys_rt_sigsuspend") __attribute_used__;
+static int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
{
sigset_t *unewset, saveset, newset;
size_t sigsetsize;
diff -Nur linux-2.4.29/arch/mips64/kernel/signal32.c linux-2.4.29-gcc3.4/arch/mips64/kernel/signal32.c
--- linux-2.4.29/arch/mips64/kernel/signal32.c 2005-01-19 15:09:33.000000000 +0100
+++ linux-2.4.29-gcc3.4/arch/mips64/kernel/signal32.c 2005-03-27 23:09:57.000000000 +0200
@@ -6,7 +6,9 @@
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright (C) 1994 - 2000 Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2004 Maciej W. Rozycki
*/
+#include <linux/compiler.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
@@ -192,7 +194,9 @@
* Atomically swap in the new signal mask, and wait for a signal.
*/
save_static_function(sys32_sigsuspend);
-static_unused int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
+static int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
+ __asm__("_sys32_sigsuspend") __attribute_used__;
+static int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
{
sigset32_t *uset;
sigset_t newset, saveset;
@@ -219,7 +223,9 @@
}
save_static_function(sys32_rt_sigsuspend);
-static_unused int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
+static int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
+ __asm__("_sys32_rt_sigsuspend") __attribute_used__;
+static int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
{
sigset32_t *uset;
sigset_t newset, saveset;
diff -Nur linux-2.4.29/arch/mips64/kernel/syscall.c linux-2.4.29-gcc3.4/arch/mips64/kernel/syscall.c
--- linux-2.4.29/arch/mips64/kernel/syscall.c 2005-01-19 15:09:33.000000000 +0100
+++ linux-2.4.29-gcc3.4/arch/mips64/kernel/syscall.c 2005-03-27 23:09:57.000000000 +0200
@@ -6,7 +6,9 @@
* Copyright (C) 1995 - 2000, 2001 by Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
* Copyright (C) 2001 MIPS Technologies, Inc.
+ * Copyright (C) 2004 Maciej W. Rozycki
*/
+#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/linkage.h>
#include <linux/mm.h>
@@ -151,7 +153,9 @@
}
save_static_function(sys_fork);
-static_unused int _sys_fork(abi64_no_regargs, struct pt_regs regs)
+static int _sys_fork(abi64_no_regargs, struct pt_regs regs)
+ __asm__("_sys_fork") __attribute_used__;
+static int _sys_fork(abi64_no_regargs, struct pt_regs regs)
{
int res;
@@ -160,7 +164,9 @@
}
save_static_function(sys_clone);
-static_unused int _sys_clone(abi64_no_regargs, struct pt_regs regs)
+static int _sys_clone(abi64_no_regargs, struct pt_regs regs)
+ __asm__("_sys_clone") __attribute_used__;
+static int _sys_clone(abi64_no_regargs, struct pt_regs regs)
{
unsigned long clone_flags;
unsigned long newsp;
diff -Nur linux-2.4.29/include/asm-mips/ptrace.h linux-2.4.29-gcc3.4/include/asm-mips/ptrace.h
--- linux-2.4.29/include/asm-mips/ptrace.h 2004-02-18 14:36:32.000000000 +0100
+++ linux-2.4.29-gcc3.4/include/asm-mips/ptrace.h 2005-03-27 23:09:57.000000000 +0200
@@ -4,6 +4,7 @@
* for more details.
*
* Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
+ * Copyright (C) 2004 Maciej W. Rozycki
*
* Machine dependent structs and defines to help the user use
* the ptrace system call.
@@ -64,12 +65,10 @@
"sw\t$22,"__str(PT_R22)"($29)\n\t" \
"sw\t$23,"__str(PT_R23)"($29)\n\t" \
"sw\t$30,"__str(PT_R30)"($29)\n\t" \
+ "j\t_" #symbol "\n\t" \
".end\t" #symbol "\n\t" \
".size\t" #symbol",. - " #symbol)
-/* Used in declaration of save_static functions. */
-#define static_unused static __attribute__((unused))
-
#endif /* !__ASSEMBLY__ */
/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
diff -Nur linux-2.4.29/include/asm-mips64/ptrace.h linux-2.4.29-gcc3.4/include/asm-mips64/ptrace.h
--- linux-2.4.29/include/asm-mips64/ptrace.h 2004-02-18 14:36:32.000000000 +0100
+++ linux-2.4.29-gcc3.4/include/asm-mips64/ptrace.h 2005-03-27 23:09:57.000000000 +0200
@@ -5,6 +5,7 @@
*
* Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2004 Maciej W. Rozycki
*/
#ifndef _ASM_PTRACE_H
#define _ASM_PTRACE_H
@@ -61,12 +62,10 @@
"sd\t$22,"__str(PT_R22)"($29)\n\t" \
"sd\t$23,"__str(PT_R23)"($29)\n\t" \
"sd\t$30,"__str(PT_R30)"($29)\n\t" \
+ "j\t_" #symbol "\n\t" \
".end\t" #symbol "\n\t" \
".size\t" #symbol",. - " #symbol)
-/* Used in declaration of save_static functions. */
-#define static_unused static __attribute__((unused))
-
#define abi64_no_regargs \
unsigned long __dummy0, \
unsigned long __dummy1, \

File diff suppressed because it is too large Load Diff

View File

@@ -1,272 +0,0 @@
--- linux-2.4.30/drivers/net/b44.c 2004-08-08 01:26:05.000000000 +0200
+++ openwrt/build_mipsel/linux-2.4.30/drivers/net/b44.c 2005-05-01 20:10:19.193354917 +0200
@@ -1,7 +1,8 @@
/* b44.c: Broadcom 4400 device driver.
*
* Copyright (C) 2002 David S. Miller (davem@redhat.com)
- * Fixed by Pekka Pietikainen (pp@ee.oulu.fi)
+ * Copyright (C) 2004 Pekka Pietikainen (pp@ee.oulu.fi)
+ * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
*
* Distribute under GPL.
*/
@@ -25,6 +26,16 @@
#include "b44.h"
+#include <typedefs.h>
+#include <bcmdevs.h>
+#include <bcmutils.h>
+#include <osl.h>
+#include <bcmutils.h>
+#include <bcmnvram.h>
+#include <sbconfig.h>
+#include <sbchipc.h>
+#include <sflash.h>
+
#define DRV_MODULE_NAME "b44"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "0.93"
@@ -75,7 +86,7 @@
DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
MODULE_AUTHOR("David S. Miller (davem@redhat.com)");
-MODULE_DESCRIPTION("Broadcom 4400 10/100 PCI ethernet driver");
+MODULE_DESCRIPTION("Broadcom 4400/47xx 10/100 PCI ethernet driver");
MODULE_LICENSE("GPL");
MODULE_PARM(b44_debug, "i");
MODULE_PARM_DESC(b44_debug, "B44 bitmapped debugging message enable value");
@@ -89,6 +100,8 @@
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4401B1,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+ { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4713,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ } /* terminate list with empty entry */
};
@@ -236,6 +249,8 @@
udelay(1);
}
+static int b44_4713_instance;
+
static int ssb_core_unit(struct b44 *bp)
{
#if 0
@@ -258,6 +273,9 @@
break;
};
#endif
+ if (bp->pdev->device == PCI_DEVICE_ID_BCM4713)
+ return b44_4713_instance++;
+ else
return 0;
}
@@ -267,6 +285,28 @@
== SBTMSLOW_CLOCK);
}
+static void __b44_cam_read(struct b44 *bp, unsigned char *data, int index)
+{
+ u32 val;
+
+ bw32(B44_CAM_CTRL, (CAM_CTRL_READ |
+ (index << CAM_CTRL_INDEX_SHIFT)));
+
+ b44_wait_bit(bp, B44_CAM_CTRL, CAM_CTRL_BUSY, 100, 1);
+
+ val = br32(B44_CAM_DATA_LO);
+
+ data[2] = (val >> 24) & 0xFF;
+ data[3] = (val >> 16) & 0xFF;
+ data[4] = (val >> 8) & 0xFF;
+ data[5] = (val >> 0) & 0xFF;
+
+ val = br32(B44_CAM_DATA_HI);
+
+ data[0] = (val >> 8) & 0xFF;
+ data[1] = (val >> 0) & 0xFF;
+}
+
static void __b44_cam_write(struct b44 *bp, unsigned char *data, int index)
{
u32 val;
@@ -307,6 +347,9 @@
{
int err;
+ if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
+ return 0;
+
bw32(B44_EMAC_ISTAT, EMAC_INT_MII);
bw32(B44_MDIO_DATA, (MDIO_DATA_SB_START |
(MDIO_OP_READ << MDIO_DATA_OP_SHIFT) |
@@ -321,6 +364,9 @@
static int b44_writephy(struct b44 *bp, int reg, u32 val)
{
+ if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
+ return 0;
+
bw32(B44_EMAC_ISTAT, EMAC_INT_MII);
bw32(B44_MDIO_DATA, (MDIO_DATA_SB_START |
(MDIO_OP_WRITE << MDIO_DATA_OP_SHIFT) |
@@ -336,6 +382,9 @@
u32 val;
int err;
+ if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
+ return 0;
+
err = b44_writephy(bp, MII_BMCR, BMCR_RESET);
if (err)
return err;
@@ -406,6 +455,9 @@
u32 val;
int err;
+ if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
+ return 0;
+
if ((err = b44_readphy(bp, B44_MII_ALEDCTRL, &val)) != 0)
goto out;
if ((err = b44_writephy(bp, B44_MII_ALEDCTRL,
@@ -498,6 +550,19 @@
{
u32 bmsr, aux;
+ if (bp->phy_addr == B44_PHY_ADDR_NO_PHY) {
+ bp->flags |= B44_FLAG_100_BASE_T;
+ bp->flags |= B44_FLAG_FULL_DUPLEX;
+ if (!netif_carrier_ok(bp->dev)) {
+ u32 val = br32(B44_TX_CTRL);
+ val |= TX_CTRL_DUPLEX;
+ bw32(B44_TX_CTRL, val);
+ netif_carrier_on(bp->dev);
+ b44_link_report(bp);
+ }
+ return;
+ }
+
if (!b44_readphy(bp, MII_BMSR, &bmsr) &&
!b44_readphy(bp, B44_MII_AUXCTRL, &aux) &&
(bmsr != 0xffff)) {
@@ -1092,6 +1157,8 @@
/* bp->lock is held. */
static void b44_chip_reset(struct b44 *bp)
{
+ unsigned int sb_clock;
+
if (ssb_is_core_up(bp)) {
bw32(B44_RCV_LAZY, 0);
bw32(B44_ENET_CTRL, ENET_CTRL_DISABLE);
@@ -1105,9 +1172,10 @@
bw32(B44_DMARX_CTRL, 0);
bp->rx_prod = bp->rx_cons = 0;
} else {
- ssb_pci_setup(bp, (bp->core_unit == 0 ?
- SBINTVEC_ENET0 :
- SBINTVEC_ENET1));
+ /*if (bp->pdev->device != PCI_DEVICE_ID_BCM4713)*/
+ ssb_pci_setup(bp, (bp->core_unit == 0 ?
+ SBINTVEC_ENET0 :
+ SBINTVEC_ENET1));
}
ssb_core_reset(bp);
@@ -1115,6 +1183,11 @@
b44_clear_stats(bp);
/* Make PHY accessible. */
+ if (bp->pdev->device == PCI_DEVICE_ID_BCM4713)
+ sb_clock = 100000000; /* 100 MHz */
+ else
+ sb_clock = 62500000; /* 62.5 MHz */
+
bw32(B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE |
(0x0d & MDIO_CTRL_MAXF_MASK)));
br32(B44_MDIO_CTRL);
@@ -1669,20 +1742,42 @@
{
u8 eeprom[128];
int err;
+ unsigned long flags;
- err = b44_read_eeprom(bp, &eeprom[0]);
- if (err)
- goto out;
-
- bp->dev->dev_addr[0] = eeprom[79];
- bp->dev->dev_addr[1] = eeprom[78];
- bp->dev->dev_addr[2] = eeprom[81];
- bp->dev->dev_addr[3] = eeprom[80];
- bp->dev->dev_addr[4] = eeprom[83];
- bp->dev->dev_addr[5] = eeprom[82];
-
- bp->phy_addr = eeprom[90] & 0x1f;
- bp->mdc_port = (eeprom[90] >> 14) & 0x1;
+ if (bp->pdev->device == PCI_DEVICE_ID_BCM4713) {
+ /*
+ * BCM47xx boards don't have a EEPROM. The MAC is stored in
+ * a NVRAM area somewhere in the flash memory. As we don't
+ * know the location and/or the format of the NVRAM area
+ * here, we simply rely on the bootloader to write the
+ * MAC into the CAM.
+ */
+ spin_lock_irqsave(&bp->lock, flags);
+ __b44_cam_read(bp, bp->dev->dev_addr, 0);
+ spin_unlock_irqrestore(&bp->lock, flags);
+
+ /*
+ * BCM47xx boards don't have a PHY. Usually there is a switch
+ * chip with multiple PHYs connected to the PHY port.
+ */
+ bp->phy_addr = B44_PHY_ADDR_NO_PHY;
+ bp->dma_offset = 0;
+ } else {
+ err = b44_read_eeprom(bp, &eeprom[0]);
+ if (err)
+ return err;
+
+ bp->dev->dev_addr[0] = eeprom[79];
+ bp->dev->dev_addr[1] = eeprom[78];
+ bp->dev->dev_addr[2] = eeprom[81];
+ bp->dev->dev_addr[3] = eeprom[80];
+ bp->dev->dev_addr[4] = eeprom[83];
+ bp->dev->dev_addr[5] = eeprom[82];
+
+ bp->phy_addr = eeprom[90] & 0x1f;
+ bp->dma_offset = SB_PCI_DMA;
+ bp->mdc_port = (eeprom[90] >> 14) & 0x1;
+ }
/* With this, plus the rx_header prepended to the data by the
* hardware, we'll land the ethernet header on a 2-byte boundary.
@@ -1692,13 +1787,12 @@
bp->imask = IMASK_DEF;
bp->core_unit = ssb_core_unit(bp);
- bp->dma_offset = ssb_get_addr(bp, SBID_PCI_DMA, 0);
/* XXX - really required?
bp->flags |= B44_FLAG_BUGGY_TXPTR;
*/
-out:
- return err;
+
+ return 0;
}
static int __devinit b44_init_one(struct pci_dev *pdev,
@@ -1819,7 +1913,8 @@
pci_save_state(bp->pdev, bp->pci_cfg_state);
- printk(KERN_INFO "%s: Broadcom 4400 10/100BaseT Ethernet ", dev->name);
+ printk(KERN_INFO "%s: Broadcom %s 10/100BaseT Ethernet ", dev->name,
+ (pdev->device == PCI_DEVICE_ID_BCM4713) ? "47xx" : "4400");
for (i = 0; i < 6; i++)
printk("%2.2x%c", dev->dev_addr[i],
i == 5 ? '\n' : ':');

View File

@@ -1,20 +0,0 @@
--- ../../buildroot-unpacked/build_mipsel/linux/net/ipv4/netfilter/ip_conntrack_core.c 2004-11-28 22:59:36.000000000 -0500
+++ linux/net/ipv4/netfilter/ip_conntrack_core.c 2004-11-30 05:05:32.000000000 -0500
@@ -1386,7 +1386,7 @@
nf_unregister_sockopt(&so_getorigdst);
}
-static int hashsize = 0;
+static int hashsize = 5953
MODULE_PARM(hashsize, "i");
int __init ip_conntrack_init(void)
@@ -1407,7 +1407,7 @@
if (ip_conntrack_htable_size < 16)
ip_conntrack_htable_size = 16;
}
- ip_conntrack_max = 8 * ip_conntrack_htable_size;
+ ip_conntrack_max = ip_conntrack_htable_size;
printk("ip_conntrack version %s (%u buckets, %d max)"
" - %Zd bytes per conntrack\n", IP_CONNTRACK_VERSION,

View File

@@ -1,140 +0,0 @@
packaging/utils/nattpatch 2.4
--- linux/include/net/sock.h 2002/02/06 15:25:10 1.1
+++ linux/include/net/sock.h 2002/05/22 12:14:56
@@ -488,7 +488,13 @@
} bictcp;
};
-
+#if 1
+#define UDP_OPT_IN_SOCK 1
+struct udp_opt {
+ __u32 esp_in_udp;
+};
+#endif
+
/*
* This structure really needs to be cleaned up.
* Most of it is for TCP, and not used by any of
@@ -655,6 +661,9 @@
#if defined(CONFIG_SPX) || defined (CONFIG_SPX_MODULE)
struct spx_opt af_spx;
#endif /* CONFIG_SPX */
+#if 1
+ struct udp_opt af_udp;
+#endif
} tp_pinfo;
--- linux/net/Config.in.orig Fri Feb 9 14:34:13 2001
+++ linux/net/Config.in Thu Feb 22 19:40:08 2001
@@ -88,3 +88,5 @@
endmenu
+bool 'IPSEC NAT-Traversal' CONFIG_IPSEC_NAT_TRAVERSAL
+
endmenu
--- linux/net/ipv4/udp.c.1 Wed Jan 28 15:57:05 2004
+++ linux/net/ipv4/udp.c Wed Jan 28 15:58:56 2004
@@ -787,6 +787,9 @@
static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
{
+#ifdef CONFIG_IPSEC_NAT_TRAVERSAL
+ struct udp_opt *tp = &(sk->tp_pinfo.af_udp);
+#endif
/*
* Charge it to the socket, dropping if the queue is full.
*/
@@ -804,6 +807,40 @@
}
#endif
+#ifdef CONFIG_IPSEC_NAT_TRAVERSAL
+ if (tp->esp_in_udp) {
+ /*
+ * Set skb->sk and xmit packet to ipsec_rcv.
+ *
+ * If ret != 0, ipsec_rcv refused the packet (not ESPinUDP),
+ * restore skb->sk and fall back to sock_queue_rcv_skb
+ */
+ struct inet_protocol *esp = NULL;
+
+#if defined(CONFIG_KLIPS) && !defined(CONFIG_KLIPS_MODULE)
+ /* optomize only when we know it is statically linked */
+ extern struct inet_protocol esp_protocol;
+ esp = &esp_protocol;
+#else
+ for (esp = (struct inet_protocol *)inet_protos[IPPROTO_ESP & (MAX_INET_PROTOS - 1)];
+ (esp) && (esp->protocol != IPPROTO_ESP);
+ esp = esp->next);
+#endif
+
+ if (esp && esp->handler) {
+ struct sock *sav_sk = skb->sk;
+ skb->sk = sk;
+ if (esp->handler(skb) == 0) {
+ skb->sk = sav_sk;
+ /*not sure we might count ESPinUDP as UDP...*/
+ UDP_INC_STATS_BH(UdpInDatagrams);
+ return 0;
+ }
+ skb->sk = sav_sk;
+ }
+ }
+#endif
+
if (sock_queue_rcv_skb(sk,skb)<0) {
UDP_INC_STATS_BH(UdpInErrors);
IP_INC_STATS_BH(IpInDiscards);
@@ -1027,13 +1064,49 @@
return len;
}
+static int udp_setsockopt(struct sock *sk, int level, int optname,
+ char *optval, int optlen)
+{
+ struct udp_opt *tp = &(sk->tp_pinfo.af_udp);
+ int val;
+ int err = 0;
+
+ if (level != SOL_UDP)
+ return ip_setsockopt(sk, level, optname, optval, optlen);
+
+ if(optlen<sizeof(int))
+ return -EINVAL;
+
+ if (get_user(val, (int *)optval))
+ return -EFAULT;
+
+ lock_sock(sk);
+
+ switch(optname) {
+#ifdef CONFIG_IPSEC_NAT_TRAVERSAL
+#ifndef UDP_ESPINUDP
+#define UDP_ESPINUDP 100
+#endif
+ case UDP_ESPINUDP:
+ tp->esp_in_udp = val;
+ break;
+#endif
+ default:
+ err = -ENOPROTOOPT;
+ break;
+ }
+
+ release_sock(sk);
+ return err;
+}
+
struct proto udp_prot = {
name: "UDP",
close: udp_close,
connect: udp_connect,
disconnect: udp_disconnect,
ioctl: udp_ioctl,
- setsockopt: ip_setsockopt,
+ setsockopt: udp_setsockopt,
getsockopt: ip_getsockopt,
sendmsg: udp_sendmsg,
recvmsg: udp_recvmsg,

View File

@@ -1,180 +0,0 @@
diff -urN linux-2.4.30.old/Documentation/Configure.help linux-2.4.30.dev/Documentation/Configure.help
--- linux-2.4.30.old/Documentation/Configure.help 2005-04-27 11:35:46.000000000 +0200
+++ linux-2.4.30.dev/Documentation/Configure.help 2005-04-27 11:43:49.000000000 +0200
@@ -3209,6 +3209,15 @@
If you want to compile it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say `N'.
+TTL target support
+CONFIG_IP_NF_TARGET_TTL
+ This option adds a `TTL' target, which enables the user to set
+ the TTL value or increment / decrement the TTL value by a given
+ amount.
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
ipchains (2.2-style) support
CONFIG_IP_NF_COMPAT_IPCHAINS
This option places ipchains (with masquerading and redirection
diff -urN linux-2.4.30.old/include/linux/netfilter_ipv4/ipt_TTL.h linux-2.4.30.dev/include/linux/netfilter_ipv4/ipt_TTL.h
--- linux-2.4.30.old/include/linux/netfilter_ipv4/ipt_TTL.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.30.dev/include/linux/netfilter_ipv4/ipt_TTL.h 2005-04-27 11:43:49.000000000 +0200
@@ -0,0 +1,21 @@
+/* TTL modification module for IP tables
+ * (C) 2000 by Harald Welte <laforge@gnumonks.org> */
+
+#ifndef _IPT_TTL_H
+#define _IPT_TTL_H
+
+enum {
+ IPT_TTL_SET = 0,
+ IPT_TTL_INC,
+ IPT_TTL_DEC
+};
+
+#define IPT_TTL_MAXMODE IPT_TTL_DEC
+
+struct ipt_TTL_info {
+ u_int8_t mode;
+ u_int8_t ttl;
+};
+
+
+#endif
diff -urN linux-2.4.30.old/net/ipv4/netfilter/Config.in linux-2.4.30.dev/net/ipv4/netfilter/Config.in
--- linux-2.4.30.old/net/ipv4/netfilter/Config.in 2005-04-27 11:35:45.000000000 +0200
+++ linux-2.4.30.dev/net/ipv4/netfilter/Config.in 2005-04-27 11:43:49.000000000 +0200
@@ -129,6 +129,7 @@
dep_tristate ' MARK target support' CONFIG_IP_NF_TARGET_MARK $CONFIG_IP_NF_MANGLE
fi
dep_tristate ' LOG target support' CONFIG_IP_NF_TARGET_LOG $CONFIG_IP_NF_IPTABLES
+ dep_tristate ' TTL target support' CONFIG_IP_NF_TARGET_TTL $CONFIG_IP_NF_IPTABLES
dep_tristate ' ULOG target support' CONFIG_IP_NF_TARGET_ULOG $CONFIG_IP_NF_IPTABLES
dep_tristate ' TCPMSS target support' CONFIG_IP_NF_TARGET_TCPMSS $CONFIG_IP_NF_IPTABLES
fi
diff -urN linux-2.4.30.old/net/ipv4/netfilter/ipt_TTL.c linux-2.4.30.dev/net/ipv4/netfilter/ipt_TTL.c
--- linux-2.4.30.old/net/ipv4/netfilter/ipt_TTL.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.30.dev/net/ipv4/netfilter/ipt_TTL.c 2005-04-27 11:43:49.000000000 +0200
@@ -0,0 +1,110 @@
+/* TTL modification target for IP tables
+ * (C) 2000 by Harald Welte <laforge@gnumonks.org>
+ *
+ * Version: $Revision$
+ *
+ * This software is distributed under the terms of GNU GPL
+ */
+
+#include <linux/module.h>
+#include <linux/skbuff.h>
+#include <linux/ip.h>
+#include <net/checksum.h>
+
+#include <linux/netfilter_ipv4/ip_tables.h>
+#include <linux/netfilter_ipv4/ipt_TTL.h>
+
+MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
+MODULE_DESCRIPTION("IP tables TTL modification module");
+MODULE_LICENSE("GPL");
+
+static unsigned int ipt_ttl_target(struct sk_buff **pskb, unsigned int hooknum,
+ const struct net_device *in, const struct net_device *out,
+ const void *targinfo, void *userinfo)
+{
+ struct iphdr *iph = (*pskb)->nh.iph;
+ const struct ipt_TTL_info *info = targinfo;
+ u_int16_t diffs[2];
+ int new_ttl;
+
+ switch (info->mode) {
+ case IPT_TTL_SET:
+ new_ttl = info->ttl;
+ break;
+ case IPT_TTL_INC:
+ new_ttl = iph->ttl + info->ttl;
+ if (new_ttl > 255)
+ new_ttl = 255;
+ break;
+ case IPT_TTL_DEC:
+ new_ttl = iph->ttl - info->ttl;
+ if (new_ttl < 0)
+ new_ttl = 0;
+ break;
+ default:
+ new_ttl = iph->ttl;
+ break;
+ }
+
+ if (new_ttl != iph->ttl) {
+ diffs[0] = htons(((unsigned)iph->ttl) << 8) ^ 0xFFFF;
+ iph->ttl = new_ttl;
+ diffs[1] = htons(((unsigned)iph->ttl) << 8);
+ iph->check = csum_fold(csum_partial((char *)diffs,
+ sizeof(diffs),
+ iph->check^0xFFFF));
+ (*pskb)->nfcache |= NFC_ALTERED;
+ }
+
+ return IPT_CONTINUE;
+}
+
+static int ipt_ttl_checkentry(const char *tablename,
+ const struct ipt_entry *e,
+ void *targinfo,
+ unsigned int targinfosize,
+ unsigned int hook_mask)
+{
+ struct ipt_TTL_info *info = targinfo;
+
+ if (targinfosize != IPT_ALIGN(sizeof(struct ipt_TTL_info))) {
+ printk(KERN_WARNING "TTL: targinfosize %u != %Zu\n",
+ targinfosize,
+ IPT_ALIGN(sizeof(struct ipt_TTL_info)));
+ return 0;
+ }
+
+ if (strcmp(tablename, "mangle")) {
+ printk(KERN_WARNING "TTL: can only be called from \"mangle\" table, not \"%s\"\n", tablename);
+ return 0;
+ }
+
+ if (info->mode > IPT_TTL_MAXMODE) {
+ printk(KERN_WARNING "TTL: invalid or unknown Mode %u\n",
+ info->mode);
+ return 0;
+ }
+
+ if ((info->mode != IPT_TTL_SET) && (info->ttl == 0)) {
+ printk(KERN_WARNING "TTL: increment/decrement doesn't make sense with value 0\n");
+ return 0;
+ }
+
+ return 1;
+}
+
+static struct ipt_target ipt_TTL = { { NULL, NULL }, "TTL",
+ ipt_ttl_target, ipt_ttl_checkentry, NULL, THIS_MODULE };
+
+static int __init init(void)
+{
+ return ipt_register_target(&ipt_TTL);
+}
+
+static void __exit fini(void)
+{
+ ipt_unregister_target(&ipt_TTL);
+}
+
+module_init(init);
+module_exit(fini);
diff -urN linux-2.4.30.old/net/ipv4/netfilter/Makefile linux-2.4.30.dev/net/ipv4/netfilter/Makefile
--- linux-2.4.30.old/net/ipv4/netfilter/Makefile 2005-04-27 11:35:45.000000000 +0200
+++ linux-2.4.30.dev/net/ipv4/netfilter/Makefile 2005-04-27 11:43:49.000000000 +0200
@@ -112,6 +112,7 @@
obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
obj-$(CONFIG_IP_NF_NAT_SNMP_BASIC) += ip_nat_snmp_basic.o
obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
+obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o
obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o
obj-$(CONFIG_IP_NF_TARGET_TCPMSS) += ipt_TCPMSS.o

View File

@@ -1,198 +0,0 @@
diff -urN linux-2.4.30.old/drivers/i2c/i2c-core.c linux-2.4.30.dev/drivers/i2c/i2c-core.c
--- linux-2.4.30.old/drivers/i2c/i2c-core.c 2005-04-29 17:59:04.000000000 +0200
+++ linux-2.4.30.dev/drivers/i2c/i2c-core.c 2005-04-29 18:42:37.000000000 +0200
@@ -750,7 +750,7 @@
msg.addr = client->addr;
msg.flags = client->flags & I2C_M_TEN;
msg.len = count;
- (const char *)msg.buf = buf;
+ msg.buf = (__u8 *)buf;
DEB2(printk(KERN_DEBUG "i2c-core.o: master_send: writing %d bytes on %s.\n",
count,client->adapter->name));
@@ -780,7 +780,7 @@
msg.flags = client->flags & I2C_M_TEN;
msg.flags |= I2C_M_RD;
msg.len = count;
- msg.buf = buf;
+ msg.buf = (__u8 *)buf;
DEB2(printk(KERN_DEBUG "i2c-core.o: master_recv: reading %d bytes on %s.\n",
count,client->adapter->name));
diff -urN linux-2.4.30.old/drivers/usb/inode.c linux-2.4.30.dev/drivers/usb/inode.c
--- linux-2.4.30.old/drivers/usb/inode.c 2004-02-18 14:36:31.000000000 +0100
+++ linux-2.4.30.dev/drivers/usb/inode.c 2005-04-29 18:42:37.000000000 +0200
@@ -42,6 +42,8 @@
#include <asm/uaccess.h>
/* --------------------------------------------------------------------- */
+static struct file_operations usbdevfs_bus_file_operations;
+static struct inode_operations usbdevfs_bus_inode_operations;
/*
* This list of superblocks is still used,
diff -urN linux-2.4.30.old/include/asm-mips/uaccess.h linux-2.4.30.dev/include/asm-mips/uaccess.h
--- linux-2.4.30.old/include/asm-mips/uaccess.h 2005-01-19 15:10:12.000000000 +0100
+++ linux-2.4.30.dev/include/asm-mips/uaccess.h 2005-04-29 18:42:37.000000000 +0200
@@ -149,7 +149,7 @@
* Returns zero on success, or -EFAULT on error.
*/
#define put_user(x,ptr) \
- __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
+ __put_user_check((x),(ptr),sizeof(*(ptr)))
/*
* get_user: - Get a simple variable from user space.
@@ -169,7 +169,7 @@
* On error, the variable @x is set to zero.
*/
#define get_user(x,ptr) \
- __get_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
+ __get_user_check((x),(ptr),sizeof(*(ptr)))
/*
* __put_user: - Write a simple value into user space, with less checking.
@@ -191,7 +191,7 @@
* Returns zero on success, or -EFAULT on error.
*/
#define __put_user(x,ptr) \
- __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
+ __put_user_nocheck((x),(ptr),sizeof(*(ptr)))
/*
* __get_user: - Get a simple variable from user space, with less checking.
@@ -214,7 +214,7 @@
* On error, the variable @x is set to zero.
*/
#define __get_user(x,ptr) \
- __get_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
+ __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
struct __large_struct { unsigned long buf[100]; };
#define __m(x) (*(struct __large_struct *)(x))
@@ -232,7 +232,7 @@
#define __get_user_nocheck(x,ptr,size) \
({ \
long __gu_err = 0; \
- __typeof(*(ptr)) __gu_val = 0; \
+ __typeof(*(ptr)) __gu_val = (__typeof(*(ptr))) 0; \
long __gu_addr; \
__gu_addr = (long) (ptr); \
switch (size) { \
diff -urN linux-2.4.30.old/include/linux/byteorder/swab.h linux-2.4.30.dev/include/linux/byteorder/swab.h
--- linux-2.4.30.old/include/linux/byteorder/swab.h 2002-11-29 00:53:15.000000000 +0100
+++ linux-2.4.30.dev/include/linux/byteorder/swab.h 2005-04-29 18:42:37.000000000 +0200
@@ -156,7 +156,7 @@
#endif /* OPTIMIZE */
-static __inline__ __const__ __u16 __fswab16(__u16 x)
+static __inline__ __u16 __fswab16(__u16 x)
{
return __arch__swab16(x);
}
@@ -169,7 +169,7 @@
__arch__swab16s(addr);
}
-static __inline__ __const__ __u32 __fswab24(__u32 x)
+static __inline__ __u32 __fswab24(__u32 x)
{
return __arch__swab24(x);
}
@@ -182,7 +182,7 @@
__arch__swab24s(addr);
}
-static __inline__ __const__ __u32 __fswab32(__u32 x)
+static __inline__ __u32 __fswab32(__u32 x)
{
return __arch__swab32(x);
}
@@ -196,7 +196,7 @@
}
#ifdef __BYTEORDER_HAS_U64__
-static __inline__ __const__ __u64 __fswab64(__u64 x)
+static __inline__ __u64 __fswab64(__u64 x)
{
# ifdef __SWAB_64_THRU_32__
__u32 h = x >> 32;
diff -urN linux-2.4.30.old/include/linux/fs.h linux-2.4.30.dev/include/linux/fs.h
--- linux-2.4.30.old/include/linux/fs.h 2005-04-29 17:59:08.000000000 +0200
+++ linux-2.4.30.dev/include/linux/fs.h 2005-04-29 18:42:37.000000000 +0200
@@ -1563,7 +1563,6 @@
unsigned long generate_cluster(kdev_t, int b[], int);
unsigned long generate_cluster_swab32(kdev_t, int b[], int);
extern kdev_t ROOT_DEV;
-extern char root_device_name[];
extern void show_buffers(void);
diff -urN linux-2.4.30.old/include/linux/i2c.h linux-2.4.30.dev/include/linux/i2c.h
--- linux-2.4.30.old/include/linux/i2c.h 2005-01-19 15:10:12.000000000 +0100
+++ linux-2.4.30.dev/include/linux/i2c.h 2005-04-29 18:42:37.000000000 +0200
@@ -70,7 +70,7 @@
/* Transfer num messages.
*/
-extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num);
+extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num);
/*
* Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor.
@@ -197,7 +197,7 @@
to NULL. If an adapter algorithm can do SMBus access, set
smbus_xfer. If set to NULL, the SMBus protocol is simulated
using common I2C messages */
- int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[],
+ int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,
int num);
int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write,
diff -urN linux-2.4.30.old/include/linux/usbdevice_fs.h linux-2.4.30.dev/include/linux/usbdevice_fs.h
--- linux-2.4.30.old/include/linux/usbdevice_fs.h 2003-11-28 19:26:21.000000000 +0100
+++ linux-2.4.30.dev/include/linux/usbdevice_fs.h 2005-04-29 18:42:37.000000000 +0200
@@ -185,8 +185,6 @@
extern struct file_operations usbdevfs_devices_fops;
extern struct file_operations usbdevfs_device_file_operations;
extern struct inode_operations usbdevfs_device_inode_operations;
-extern struct inode_operations usbdevfs_bus_inode_operations;
-extern struct file_operations usbdevfs_bus_file_operations;
extern void usbdevfs_conn_disc_event(void);
#endif /* __KERNEL__ */
diff -urN linux-2.4.30.old/include/net/icmp.h linux-2.4.30.dev/include/net/icmp.h
--- linux-2.4.30.old/include/net/icmp.h 2001-11-22 20:47:15.000000000 +0100
+++ linux-2.4.30.dev/include/net/icmp.h 2005-04-29 18:42:37.000000000 +0200
@@ -23,6 +23,7 @@
#include <net/sock.h>
#include <net/protocol.h>
+#include <net/snmp.h>
struct icmp_err {
int errno;
diff -urN linux-2.4.30.old/include/net/ipv6.h linux-2.4.30.dev/include/net/ipv6.h
--- linux-2.4.30.old/include/net/ipv6.h 2004-11-17 12:54:22.000000000 +0100
+++ linux-2.4.30.dev/include/net/ipv6.h 2005-04-29 18:42:37.000000000 +0200
@@ -19,6 +19,7 @@
#include <asm/hardirq.h>
#include <net/ndisc.h>
#include <net/flow.h>
+#include <net/snmp.h>
#define SIN6_LEN_RFC2133 24
diff -urN linux-2.4.30.old/include/linux/netfilter_ipv4/ip_tables.h linux-2.4.30.dev/include/linux/netfilter_ipv4/ip_tables.h
--- linux-2.4.30.old/include/linux/netfilter_ipv4/ip_tables.h 2005-04-29 17:59:08.000000000 +0200
+++ linux-2.4.30.dev/include/linux/netfilter_ipv4/ip_tables.h 2005-04-29 19:06:36.000000000 +0200
@@ -283,7 +283,7 @@
struct ipt_entry entrytable[0];
};
-extern struct semaphore ipt_mutex;
+// extern struct semaphore ipt_mutex;
/* Standard return verdict, or do jump. */
#define IPT_STANDARD_TARGET ""

View File

@@ -1,11 +0,0 @@
--- linux-2.4.30/drivers/net/b44.h 2003-08-25 13:44:42.000000000 +0200
+++ openwrt/build_mipsel/linux-2.4.30/drivers/net/b44.h 2005-05-01 14:43:20.000000000 +0200
@@ -461,6 +461,8 @@
};
#define B44_MCAST_TABLE_SIZE 32
+#define B44_PHY_ADDR_NO_PHY 30
+#define B44_MDC_RATIO 5000000
/* SW copy of device statistics, kept up to date by periodic timer
* which probes HW values. Must have same relative layout as HW

View File

@@ -1,10 +0,0 @@
--- linux-2.4.30/include/linux/pci_ids.h 2005-04-04 03:42:20.000000000 +0200
+++ openwrt/build_mipsel/linux-2.4.30/include/linux/pci_ids.h 2005-05-01 14:43:20.000000000 +0200
@@ -1735,6 +1735,7 @@
#define PCI_DEVICE_ID_TIGON3_5901_2 0x170e
#define PCI_DEVICE_ID_BCM4401 0x4401
#define PCI_DEVICE_ID_BCM4401B0 0x4402
+#define PCI_DEVICE_ID_BCM4713 0x4713
#define PCI_VENDOR_ID_ENE 0x1524
#define PCI_DEVICE_ID_ENE_1211 0x1211

View File

@@ -1,89 +0,0 @@
--- linux-2.4.30.old/drivers/net/b44.c 2005-05-01 23:30:22.000000000 +0400
+++ linux-2.4.30/drivers/net/b44.c 2005-05-10 16:51:24.410654488 +0400
@@ -343,17 +343,14 @@
bw32(B44_IMASK, bp->imask);
}
-static int b44_readphy(struct b44 *bp, int reg, u32 *val)
+static int __b44_readphy(struct b44 *bp, int phy_addr, int reg, u32 *val)
{
int err;
- if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
- return 0;
-
bw32(B44_EMAC_ISTAT, EMAC_INT_MII);
bw32(B44_MDIO_DATA, (MDIO_DATA_SB_START |
(MDIO_OP_READ << MDIO_DATA_OP_SHIFT) |
- (bp->phy_addr << MDIO_DATA_PMD_SHIFT) |
+ (phy_addr << MDIO_DATA_PMD_SHIFT) |
(reg << MDIO_DATA_RA_SHIFT) |
(MDIO_TA_VALID << MDIO_DATA_TA_SHIFT)));
err = b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
@@ -362,21 +359,34 @@
return err;
}
-static int b44_writephy(struct b44 *bp, int reg, u32 val)
+static int b44_readphy(struct b44 *bp, int reg, u32 *val)
{
if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
return 0;
+ return __b44_readphy(bp, bp->phy_addr, reg, val);
+}
+
+static int __b44_writephy(struct b44 *bp, int phy_addr, int reg, u32 val)
+{
bw32(B44_EMAC_ISTAT, EMAC_INT_MII);
bw32(B44_MDIO_DATA, (MDIO_DATA_SB_START |
(MDIO_OP_WRITE << MDIO_DATA_OP_SHIFT) |
- (bp->phy_addr << MDIO_DATA_PMD_SHIFT) |
+ (phy_addr << MDIO_DATA_PMD_SHIFT) |
(reg << MDIO_DATA_RA_SHIFT) |
(MDIO_TA_VALID << MDIO_DATA_TA_SHIFT) |
(val & MDIO_DATA_DATA)));
return b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
}
+static int b44_writephy(struct b44 *bp, int reg, u32 val)
+{
+ if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
+ return 0;
+
+ return __b44_writephy(bp, bp->phy_addr, reg, val);
+}
+
static int b44_phy_reset(struct b44 *bp)
{
u32 val;
@@ -1701,7 +1711,7 @@
u32 mii_regval;
spin_lock_irq(&bp->lock);
- err = b44_readphy(bp, data->reg_num & 0x1f, &mii_regval);
+ err = __b44_readphy(bp, data->phy_id & 0x1f, data->reg_num & 0x1f, &mii_regval);
spin_unlock_irq(&bp->lock);
data->val_out = mii_regval;
@@ -1714,7 +1724,7 @@
return -EPERM;
spin_lock_irq(&bp->lock);
- err = b44_writephy(bp, data->reg_num & 0x1f, data->val_in);
+ err = __b44_writephy(bp, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in);
spin_unlock_irq(&bp->lock);
return err;
@@ -1919,6 +1929,11 @@
printk("%2.2x%c", dev->dev_addr[i],
i == 5 ? '\n' : ':');
+ /* Initialize phy */
+ spin_lock_irq(&bp->lock);
+ b44_chip_reset(bp);
+ spin_unlock_irq(&bp->lock);
+
return 0;
err_out_iounmap:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,738 +0,0 @@
diff -rNu linux-2.4.29.old/drivers/usb/serial/pl2303.c linux-2.4.29/drivers/usb/serial/pl2303.c
--- linux-2.4.29.old/drivers/usb/serial/pl2303.c 2005-03-22 14:48:04.000000000 +0100
+++ linux-2.4.29/drivers/usb/serial/pl2303.c 2005-03-22 15:33:05.735943352 +0100
@@ -1,7 +1,7 @@
/*
* Prolific PL2303 USB to serial adaptor driver
*
- * Copyright (C) 2001-2003 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (C) 2003 IBM Corp.
*
* Original driver for 2.2.x by anonymous
@@ -12,8 +12,16 @@
* (at your option) any later version.
*
* See Documentation/usb/usb-serial.txt for more information on using this driver
- * 2003_Apr_24 gkh
- * Added line error reporting support. Hopefully it is correct...
+ *
+ *
+ * 2005_Mar_05 grsch
+ * ported 2.6.8 pl2303.c to 2.4.20 format
+ * (HX model works fine now, ID table should be brought up to date)
+ * Gregor Schaffrath <gschaff@ran-dom.org>
+ *
+ * 2002_Mar_26 gkh
+ * allowed driver to work properly if there is no tty assigned to a port
+ * (this happens for serial console devices.)
*
* 2001_Oct_06 gkh
* Added RTS and DTR line control. Thanks to joe@bndlg.de for parts of it.
@@ -33,6 +41,9 @@
*
*/
+static int debug;
+
+
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -46,43 +57,44 @@
#include <linux/spinlock.h>
#include <asm/uaccess.h>
#include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
- static int debug = 1;
-#else
- static int debug;
-#endif
-
#include "usb-serial.h"
#include "pl2303.h"
/*
* Version Information
*/
-#define DRIVER_VERSION "v0.10"
+#define DRIVER_VERSION "v0.11"
#define DRIVER_DESC "Prolific PL2303 USB to serial adaptor driver"
-
-
static struct usb_device_id id_table [] = {
{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) },
{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) },
{ USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
{ USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) },
- { USB_DEVICE(ATEN_VENDOR_ID2, ATEN_PRODUCT_ID) },
{ USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) },
{ USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID) },
{ USB_DEVICE(MA620_VENDOR_ID, MA620_PRODUCT_ID) },
- { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID) },
- { USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) },
- { USB_DEVICE(RADIOSHACK_VENDOR_ID, RADIOSHACK_PRODUCT_ID) },
- { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
- { USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) },
+ { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID) },
+ { USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) },
+ { USB_DEVICE(RADIOSHACK_VENDOR_ID, RADIOSHACK_PRODUCT_ID) },
+ { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
+ { USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) },
+ { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_ID) },
+ { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, id_table);
+/*
+static struct usb_driver pl2303_driver = {
+ .owner = THIS_MODULE,
+ .name = "pl2303",
+ .probe = usb_serial_probe,
+ .disconnect = usb_serial_disconnect,
+ .id_table = id_table,
+};
+*/
#define SET_LINE_REQUEST_TYPE 0x21
#define SET_LINE_REQUEST 0x20
@@ -130,6 +142,9 @@
static int pl2303_write (struct usb_serial_port *port, int from_user,
const unsigned char *buf, int count);
static void pl2303_break_ctl(struct usb_serial_port *port,int break_state);
+static int pl2303_tiocmget (struct usb_serial_port *port, struct file *file);
+static int pl2303_tiocmset (struct usb_serial_port *port, struct file *file,
+ unsigned int set, unsigned int clear);
static int pl2303_startup (struct usb_serial *serial);
static void pl2303_shutdown (struct usb_serial *serial);
@@ -149,27 +164,48 @@
.ioctl = pl2303_ioctl,
.break_ctl = pl2303_break_ctl,
.set_termios = pl2303_set_termios,
+ //.tiocmget = pl2303_tiocmget,
+ //.tiocmset = pl2303_tiocmset,
.read_bulk_callback = pl2303_read_bulk_callback,
.read_int_callback = pl2303_read_int_callback,
.write_bulk_callback = pl2303_write_bulk_callback,
+ //.attach = pl2303_startup,
.startup = pl2303_startup,
.shutdown = pl2303_shutdown,
};
+enum pl2303_type {
+ type_0, /* don't know the difference between type 0 and */
+ type_1, /* type 1, until someone from prolific tells us... */
+ HX, /* HX version of the pl2303 chip */
+};
+
struct pl2303_private {
spinlock_t lock;
wait_queue_head_t delta_msr_wait;
u8 line_control;
u8 line_status;
u8 termios_initialized;
+ enum pl2303_type type;
};
static int pl2303_startup (struct usb_serial *serial)
{
struct pl2303_private *priv;
+ enum pl2303_type type = type_0;
int i;
+ if (serial->dev->descriptor.bDeviceClass == 0x02)
+ type = type_0;
+ else if (serial->dev->descriptor.bMaxPacketSize0 == 0x40)
+ type = HX;
+ else if (serial->dev->descriptor.bDeviceClass == 0x00)
+ type = type_1;
+ else if (serial->dev->descriptor.bDeviceClass == 0xFF)
+ type = type_1;
+ dbg("device type: %d", type);
+
for (i = 0; i < serial->num_ports; ++i) {
priv = kmalloc (sizeof (struct pl2303_private), GFP_KERNEL);
if (!priv)
@@ -177,7 +213,8 @@
memset (priv, 0x00, sizeof (struct pl2303_private));
spin_lock_init(&priv->lock);
init_waitqueue_head(&priv->delta_msr_wait);
- usb_set_serial_port_data(&serial->port[i], priv);
+ priv->type = type;
+ serial->port[i].private = priv;
}
return 0;
}
@@ -215,13 +252,13 @@
memcpy (port->write_urb->transfer_buffer, buf, count);
}
- usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer);
+ usb_serial_debug_data(__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer);
port->write_urb->transfer_buffer_length = count;
port->write_urb->dev = port->serial->dev;
result = usb_submit_urb (port->write_urb);
if (result)
- err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
+ err("%s - failed submitting write urb, error %d\n", __FUNCTION__, result);
else
result = count;
@@ -233,7 +270,7 @@
static void pl2303_set_termios (struct usb_serial_port *port, struct termios *old_termios)
{
struct usb_serial *serial = port->serial;
- struct pl2303_private *priv = usb_get_serial_port_data(port);
+ struct pl2303_private *priv = port->private;
unsigned long flags;
unsigned int cflag;
unsigned char *buf;
@@ -241,8 +278,7 @@
int i;
u8 control;
- dbg("%s - port %d, initialized = %d", __FUNCTION__, port->number,
- priv->termios_initialized);
+ dbg("%s - port %d", __FUNCTION__, port->number);
if ((!port->tty) || (!port->tty->termios)) {
dbg("%s - no tty structures", __FUNCTION__);
@@ -269,7 +305,7 @@
buf = kmalloc (7, GFP_KERNEL);
if (!buf) {
- err("%s - out of memory.", __FUNCTION__);
+ err("%s - out of memory.\n", __FUNCTION__);
return;
}
memset (buf, 0x00, 0x07);
@@ -311,7 +347,7 @@
case B230400: baud = 230400; break;
case B460800: baud = 460800; break;
default:
- err ("pl2303 driver does not support the baudrate requested (fix it)");
+ err("pl2303 driver does not support the baudrate requested (fix it)\n");
break;
}
dbg("%s - baud = %d", __FUNCTION__, baud);
@@ -380,26 +416,30 @@
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
if (cflag & CRTSCTS) {
- i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
- VENDOR_WRITE_REQUEST, VENDOR_WRITE_REQUEST_TYPE,
- 0x0, 0x41, NULL, 0, 100);
- dbg ("0x40:0x1:0x0:0x41 %d", i);
+ __u16 index;
+ if (priv->type == HX)
+ index = 0x61;
+ else
+ index = 0x41;
+ i = usb_control_msg(serial->dev,
+ usb_sndctrlpipe(serial->dev, 0),
+ VENDOR_WRITE_REQUEST,
+ VENDOR_WRITE_REQUEST_TYPE,
+ 0x0, index, NULL, 0, 100);
+ dbg ("0x40:0x1:0x0:0x%x %d", index, i);
}
kfree (buf);
-}
-
+}
static int pl2303_open (struct usb_serial_port *port, struct file *filp)
{
struct termios tmp_termios;
struct usb_serial *serial = port->serial;
+ struct pl2303_private *priv = port->private;
unsigned char *buf;
int result;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
usb_clear_halt(serial->dev, port->write_urb->pipe);
@@ -427,6 +467,18 @@
SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 1);
FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0);
FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0);
+ SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0, 1);
+ SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 1, 0);
+
+ if (priv->type == HX) {
+ /* HX chip */
+ SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 0x44);
+ /* reset upstream data pipes */
+ SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 8, 0);
+ SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 9, 0);
+ } else {
+ SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 0x24);
+ }
kfree(buf);
@@ -441,7 +493,7 @@
port->read_urb->dev = serial->dev;
result = usb_submit_urb (port->read_urb);
if (result) {
- err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
+ err("%s - failed submitting read urb, error %d\n", __FUNCTION__, result);
pl2303_close (port, NULL);
return -EPROTO;
}
@@ -450,7 +502,7 @@
port->interrupt_in_urb->dev = serial->dev;
result = usb_submit_urb (port->interrupt_in_urb);
if (result) {
- err("%s - failed submitting interrupt urb, error %d", __FUNCTION__, result);
+ err("%s - failed submitting interrupt urb, error %d\n", __FUNCTION__, result);
pl2303_close (port, NULL);
return -EPROTO;
}
@@ -460,125 +512,103 @@
static void pl2303_close (struct usb_serial_port *port, struct file *filp)
{
- struct usb_serial *serial;
struct pl2303_private *priv;
unsigned long flags;
unsigned int c_cflag;
int result;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
- serial = get_usb_serial (port, __FUNCTION__);
- if (!serial)
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
- if (serial->dev) {
- if (port->tty) {
- c_cflag = port->tty->termios->c_cflag;
- if (c_cflag & HUPCL) {
- /* drop DTR and RTS */
- priv = usb_get_serial_port_data(port);
- spin_lock_irqsave(&priv->lock, flags);
- priv->line_control = 0;
- spin_unlock_irqrestore (&priv->lock, flags);
- set_control_lines (port->serial->dev, 0);
- }
- }
+ /* shutdown our urbs */
+ dbg("%s - shutting down urbs", __FUNCTION__);
+ result = usb_unlink_urb (port->write_urb);
+ if (result)
+ dbg("%s - usb_unlink_urb (write_urb)"
+ " failed with reason: %d", __FUNCTION__,
+ result);
- /* shutdown our urbs */
- dbg("%s - shutting down urbs", __FUNCTION__);
- result = usb_unlink_urb (port->write_urb);
- if (result)
- dbg("%s - usb_unlink_urb (write_urb)"
- " failed with reason: %d", __FUNCTION__,
- result);
+ result = usb_unlink_urb (port->read_urb);
+ if (result)
+ dbg("%s - usb_unlink_urb (read_urb) "
+ "failed with reason: %d", __FUNCTION__,
+ result);
- result = usb_unlink_urb (port->read_urb);
- if (result)
- dbg("%s - usb_unlink_urb (read_urb) "
- "failed with reason: %d", __FUNCTION__,
- result);
+ result = usb_unlink_urb (port->interrupt_in_urb);
+ if (result)
+ dbg("%s - usb_unlink_urb (interrupt_in_urb)"
+ " failed with reason: %d", __FUNCTION__,
+ result);
- result = usb_unlink_urb (port->interrupt_in_urb);
- if (result)
- dbg("%s - usb_unlink_urb (interrupt_in_urb)"
- " failed with reason: %d", __FUNCTION__,
- result);
+ if (port->tty) {
+ c_cflag = port->tty->termios->c_cflag;
+ if (c_cflag & HUPCL) {
+ /* drop DTR and RTS */
+ priv = port->private;
+ spin_lock_irqsave(&priv->lock, flags);
+ priv->line_control = 0;
+ spin_unlock_irqrestore (&priv->lock, flags);
+ set_control_lines (port->serial->dev, 0);
+ }
}
+
}
+/* taken from 2.4.20 driver */
static int set_modem_info (struct usb_serial_port *port, unsigned int cmd, unsigned int *value)
{
- struct pl2303_private *priv = usb_get_serial_port_data(port);
- unsigned long flags;
- unsigned int arg;
- u8 control;
-
- if (copy_from_user(&arg, value, sizeof(int)))
- return -EFAULT;
-
- spin_lock_irqsave (&priv->lock, flags);
- switch (cmd) {
- case TIOCMBIS:
- if (arg & TIOCM_RTS)
- priv->line_control |= CONTROL_RTS;
- if (arg & TIOCM_DTR)
- priv->line_control |= CONTROL_DTR;
- break;
-
- case TIOCMBIC:
- if (arg & TIOCM_RTS)
- priv->line_control &= ~CONTROL_RTS;
- if (arg & TIOCM_DTR)
- priv->line_control &= ~CONTROL_DTR;
- break;
+ struct pl2303_private *priv = port->private;
+ unsigned int arg;
- case TIOCMSET:
- /* turn off RTS and DTR and then only turn
- on what was asked to */
- priv->line_control &= ~(CONTROL_RTS | CONTROL_DTR);
- priv->line_control |= ((arg & TIOCM_RTS) ? CONTROL_RTS : 0);
- priv->line_control |= ((arg & TIOCM_DTR) ? CONTROL_DTR : 0);
- break;
- }
- control = priv->line_control;
- spin_unlock_irqrestore (&priv->lock, flags);
-
- return set_control_lines (port->serial->dev, control);
+ if (copy_from_user(&arg, value, sizeof(int)))
+ return -EFAULT;
+
+ switch (cmd) {
+ case TIOCMBIS:
+ if (arg & TIOCM_RTS)
+ priv->line_control |= CONTROL_RTS;
+ if (arg & TIOCM_DTR)
+ priv->line_control |= CONTROL_DTR;
+ break;
+
+ case TIOCMBIC:
+ if (arg & TIOCM_RTS)
+ priv->line_control &= ~CONTROL_RTS;
+ if (arg & TIOCM_DTR)
+ priv->line_control &= ~CONTROL_DTR;
+ break;
+
+ case TIOCMSET:
+ /* turn off RTS and DTR and then only turn
+ on what was asked to */
+ priv->line_control &= ~(CONTROL_RTS | CONTROL_DTR);
+ priv->line_control |= ((arg & TIOCM_RTS) ? CONTROL_RTS : 0);
+ priv->line_control |= ((arg & TIOCM_DTR) ? CONTROL_DTR : 0);
+ break;
+ }
+
+ return set_control_lines (port->serial->dev, priv->line_control);
}
static int get_modem_info (struct usb_serial_port *port, unsigned int *value)
{
- struct pl2303_private *priv = usb_get_serial_port_data(port);
- unsigned long flags;
- unsigned int mcr;
- unsigned int status;
- unsigned int result;
-
- spin_lock_irqsave (&priv->lock, flags);
- mcr = priv->line_control;
- status = priv->line_status;
- spin_unlock_irqrestore (&priv->lock, flags);
-
- result = ((mcr & CONTROL_DTR) ? TIOCM_DTR : 0)
- | ((mcr & CONTROL_RTS) ? TIOCM_RTS : 0)
- | ((status & UART_CTS) ? TIOCM_CTS : 0)
- | ((status & UART_DSR) ? TIOCM_DSR : 0)
- | ((status & UART_RING) ? TIOCM_RI : 0)
- | ((status & UART_DCD) ? TIOCM_CD : 0);
-
- dbg("%s - result = %x", __FUNCTION__, result);
-
- if (copy_to_user(value, &result, sizeof(int)))
- return -EFAULT;
- return 0;
+ struct pl2303_private *priv = port->private;
+ unsigned int mcr = priv->line_control;
+ unsigned int result;
+
+ result = ((mcr & CONTROL_DTR) ? TIOCM_DTR : 0)
+ | ((mcr & CONTROL_RTS) ? TIOCM_RTS : 0);
+
+ dbg("%s - result = %x", __FUNCTION__, result);
+
+ if (copy_to_user(value, &result, sizeof(int)))
+ return -EFAULT;
+ return 0;
}
+/* end of 2.4.20 kernel part - grsch */
static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
{
- struct pl2303_private *priv = usb_get_serial_port_data(port);
+ struct pl2303_private *priv = port->private;
unsigned long flags;
unsigned int prevstatus;
unsigned int status;
@@ -617,21 +647,10 @@
dbg("%s (%d) cmd = 0x%04x", __FUNCTION__, port->number, cmd);
switch (cmd) {
-
- case TIOCMGET:
- dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number);
- return get_modem_info (port, (unsigned int *)arg);
-
- case TIOCMBIS:
- case TIOCMBIC:
- case TIOCMSET:
- dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number);
- return set_modem_info(port, cmd, (unsigned int *) arg);
-
case TIOCMIWAIT:
dbg("%s (%d) TIOCMIWAIT", __FUNCTION__, port->number);
return wait_modem_info(port, arg);
-
+
default:
dbg("%s not supported = 0x%04x", __FUNCTION__, cmd);
break;
@@ -652,7 +671,7 @@
state = BREAK_OFF;
else
state = BREAK_ON;
- dbg("%s - turning break %s", __FUNCTION__, state==BREAK_OFF ? "off" : "on");
+ dbg("%s - turning break %s", state==BREAK_OFF ? "off" : "on", __FUNCTION__);
result = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
BREAK_REQUEST, BREAK_REQUEST_TYPE, state,
@@ -669,8 +688,8 @@
dbg("%s", __FUNCTION__);
for (i = 0; i < serial->num_ports; ++i) {
- kfree (usb_get_serial_port_data(&serial->port[i]));
- usb_set_serial_port_data(&serial->port[i], NULL);
+ kfree (serial->port[i].private);
+ serial->port[i].private = NULL;
}
}
@@ -678,16 +697,14 @@
static void pl2303_read_int_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
- struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
- struct pl2303_private *priv = usb_get_serial_port_data(port);
+ struct pl2303_private *priv = port->private;
unsigned char *data = urb->transfer_buffer;
unsigned long flags;
+ int status;
u8 uart_state;
dbg("%s (%d)", __FUNCTION__, port->number);
- /* ints auto restart... */
-
switch (urb->status) {
case 0:
/* success */
@@ -700,17 +717,14 @@
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
- return;
+ goto exit;
}
- if (!serial) {
- return;
- }
- usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
+ usb_serial_debug_data(__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
if (urb->actual_length < UART_STATE)
- return;
+ goto exit;
/* Save off the uart status for others to look at */
uart_state = data[UART_STATE];
@@ -718,17 +732,19 @@
uart_state |= (priv->line_status & UART_STATE_TRANSIENT_MASK);
priv->line_status = uart_state;
spin_unlock_irqrestore(&priv->lock, flags);
- wake_up_interruptible (&priv->delta_msr_wait);
-
- return;
+
+exit:
+ status = usb_submit_urb (urb);
+ if (status)
+ err("%s - usb_submit_urb failed with result %d\n",
+ __FUNCTION__, status);
}
static void pl2303_read_bulk_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
- struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
- struct pl2303_private *priv = usb_get_serial_port_data(port);
+ struct pl2303_private *priv = port->private;
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
unsigned long flags;
@@ -737,16 +753,8 @@
u8 status;
char tty_flag;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
- if (!serial) {
- dbg("%s - bad serial pointer, exiting", __FUNCTION__);
- return;
- }
-
if (urb->status) {
dbg("%s - urb->status = %d", __FUNCTION__, urb->status);
if (!port->open_count) {
@@ -757,17 +765,17 @@
/* PL2303 mysteriously fails with -EPROTO reschedule the read */
dbg("%s - caught -EPROTO, resubmitting the urb", __FUNCTION__);
urb->status = 0;
- urb->dev = serial->dev;
+ urb->dev = port->serial->dev;
result = usb_submit_urb(urb);
if (result)
- err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
+ err("%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
return;
}
dbg("%s - unable to handle the error, exiting.", __FUNCTION__);
return;
}
- usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+ usb_serial_debug_data(__FILE__, __FUNCTION__, urb->actual_length, data);
/* get tty_flag from status */
tty_flag = TTY_NORMAL;
@@ -776,7 +784,7 @@
status = priv->line_status;
priv->line_status &= ~UART_STATE_TRANSIENT_MASK;
spin_unlock_irqrestore(&priv->lock, flags);
- wake_up_interruptible (&priv->delta_msr_wait); //AF from 2.6
+ wake_up_interruptible (&priv->delta_msr_wait);
/* break takes precedence over parity, */
/* which takes precedence over framing errors */
@@ -805,10 +813,10 @@
/* Schedule the next read _if_ we are still open */
if (port->open_count) {
- urb->dev = serial->dev;
+ urb->dev = port->serial->dev;
result = usb_submit_urb(urb);
if (result)
- err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
+ err("%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
}
return;
@@ -821,44 +829,32 @@
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
int result;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) {
/* error in the urb, so we have to resubmit it */
- if (serial_paranoia_check (port->serial, __FUNCTION__)) {
- return;
- }
dbg("%s - Overflow in write", __FUNCTION__);
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
port->write_urb->transfer_buffer_length = 1;
port->write_urb->dev = port->serial->dev;
result = usb_submit_urb (port->write_urb);
if (result)
- err("%s - failed resubmitting write urb, error %d", __FUNCTION__, result);
+ err("%s - failed resubmitting write urb, error %d\n", __FUNCTION__, result);
return;
}
- queue_task(&port->tqueue, &tq_immediate);
- mark_bh(IMMEDIATE_BH);
- return;
+ queue_task(&port->tqueue, &tq_immediate);
+ mark_bh(IMMEDIATE_BH);
}
static int __init pl2303_init (void)
{
- int retval;
- retval = usb_serial_register(&pl2303_device);
- if (retval)
- goto failed_usb_serial_register;
+ usb_serial_register(&pl2303_device);
info(DRIVER_DESC " " DRIVER_VERSION);
return 0;
-failed_usb_serial_register:
- return retval;
}
@@ -877,3 +873,4 @@
MODULE_PARM(debug, "i");
MODULE_PARM_DESC(debug, "Debug enabled or not");
+//this is an error
diff -rNu linux-2.4.29.old/drivers/usb/serial/pl2303.h linux-2.4.29/drivers/usb/serial/pl2303.h
--- linux-2.4.29.old/drivers/usb/serial/pl2303.h 2005-03-22 14:48:04.000000000 +0100
+++ linux-2.4.29/drivers/usb/serial/pl2303.h 2005-03-22 15:33:05.758939856 +0100
@@ -41,3 +41,12 @@
#define SITECOM_VENDOR_ID 0x6189
#define SITECOM_PRODUCT_ID 0x2068
+
+/* Alcatel OT535/735 USB cable */
+#define ALCATEL_VENDOR_ID 0x11f7
+#define ALCATEL_PRODUCT_ID 0x02df
+
+/* Samsung I330 phone cradle */
+#define SAMSUNG_VENDOR_ID 0x04e8
+#define SAMSUNG_PRODUCT_ID 0x8001
+

View File

@@ -1,296 +0,0 @@
diff -urN linux-2.4.26-pre5/Documentation/Configure.help linux-2.4.26-pre5-netdev-core/Documentation/Configure.help
--- linux-2.4.26-pre5/Documentation/Configure.help Sat Mar 20 10:08:18 2004
+++ linux-2.4.26-pre5-netdev-core/Documentation/Configure.help Sun Mar 21 10:16:14 2004
@@ -10419,6 +10419,20 @@
If you don't know what to use this for, you don't need it.
+Allow Net Devices to contribute to /dev/random
+CONFIG_NET_RANDOM
+ If you say Y here, network device interrupts will contribute to the
+ kernel entropy pool. Normally, block devices and some other devices
+ feed the pool. Some systems, such as those that are headless or diskless,
+ need additional entropy sources. Some people, however, feel that network
+ devices should not contribute to /dev/random because an external attacker
+ could observe incoming packets in an attempt to learn the entropy pool's
+ state. If you say N, no network device will contribute entropy.
+
+ If you believe there is a chance of your network packets being observed
+ and you doubt the security of the entropy pool's one-way hash, do not
+ enable this. If unsure, say N.
+
Ethertap network tap (OBSOLETE)
CONFIG_ETHERTAP
If you say Y here (and have said Y to "Kernel/User network link
diff -urN linux-2.4.26-pre5/drivers/net/Config.in linux-2.4.26-pre5-netdev-core/drivers/net/Config.in
--- linux-2.4.26-pre5/drivers/net/Config.in Sat Mar 20 10:08:18 2004
+++ linux-2.4.26-pre5-netdev-core/drivers/net/Config.in Sun Mar 21 10:16:14 2004
@@ -8,6 +8,7 @@
tristate 'Bonding driver support' CONFIG_BONDING
tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER
tristate 'Universal TUN/TAP device driver support' CONFIG_TUN
+bool 'Allow Net Devices to contribute to /dev/random' CONFIG_NET_RANDOM
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'Ethertap network tap (OBSOLETE)' CONFIG_ETHERTAP
fi
diff -urN linux-2.4.26-pre5/include/asm-alpha/signal.h linux-2.4.26-pre5-netdev-core/include/asm-alpha/signal.h
--- linux-2.4.26-pre5/include/asm-alpha/signal.h Sat Dec 1 18:27:14 2001
+++ linux-2.4.26-pre5-netdev-core/include/asm-alpha/signal.h Sun Mar 21 10:16:14 2004
@@ -121,7 +121,14 @@
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x40000000
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
#endif
+
+#endif /* __KERNEL__ */
#define SIG_BLOCK 1 /* for blocking signals */
#define SIG_UNBLOCK 2 /* for unblocking signals */
diff -urN linux-2.4.26-pre5/include/asm-arm/signal.h linux-2.4.26-pre5-netdev-core/include/asm-arm/signal.h
--- linux-2.4.26-pre5/include/asm-arm/signal.h Sat Sep 13 07:57:29 2003
+++ linux-2.4.26-pre5-netdev-core/include/asm-arm/signal.h Sun Mar 21 10:16:14 2004
@@ -125,7 +125,14 @@
#define SA_PROBE 0x80000000
#define SA_SAMPLE_RANDOM 0x10000000
#define SA_SHIRQ 0x04000000
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
#endif
+
+#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
diff -urN linux-2.4.26-pre5/include/asm-cris/signal.h linux-2.4.26-pre5-netdev-core/include/asm-cris/signal.h
--- linux-2.4.26-pre5/include/asm-cris/signal.h Sat Dec 1 18:27:14 2001
+++ linux-2.4.26-pre5-netdev-core/include/asm-cris/signal.h Sun Mar 21 10:16:14 2004
@@ -120,7 +120,14 @@
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
#endif
+
+#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
diff -urN linux-2.4.26-pre5/include/asm-i386/signal.h linux-2.4.26-pre5-netdev-core/include/asm-i386/signal.h
--- linux-2.4.26-pre5/include/asm-i386/signal.h Sun Mar 21 00:00:43 2004
+++ linux-2.4.26-pre5-netdev-core/include/asm-i386/signal.h Sun Mar 21 10:16:14 2004
@@ -119,7 +119,14 @@
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
#endif
+
+#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
diff -urN linux-2.4.26-pre5/include/asm-ia64/signal.h linux-2.4.26-pre5-netdev-core/include/asm-ia64/signal.h
--- linux-2.4.26-pre5/include/asm-ia64/signal.h Sat Mar 20 10:08:20 2004
+++ linux-2.4.26-pre5-netdev-core/include/asm-ia64/signal.h Sun Mar 21 10:16:14 2004
@@ -117,6 +117,12 @@
#define SA_SHIRQ 0x04000000
#define SA_PERCPU_IRQ 0x02000000
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
+#endif
+
#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
diff -urN linux-2.4.26-pre5/include/asm-m68k/signal.h linux-2.4.26-pre5-netdev-core/include/asm-m68k/signal.h
--- linux-2.4.26-pre5/include/asm-m68k/signal.h Fri Feb 20 07:38:33 2004
+++ linux-2.4.26-pre5-netdev-core/include/asm-m68k/signal.h Sun Mar 21 10:16:14 2004
@@ -116,7 +116,14 @@
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
#endif
+
+#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
diff -urN linux-2.4.26-pre5/include/asm-mips/signal.h linux-2.4.26-pre5-netdev-core/include/asm-mips/signal.h
--- linux-2.4.26-pre5/include/asm-mips/signal.h Sat Sep 13 07:57:31 2003
+++ linux-2.4.26-pre5-netdev-core/include/asm-mips/signal.h Sun Mar 21 10:16:14 2004
@@ -111,6 +111,12 @@
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x02000000
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
+#endif
+
#endif /* __KERNEL__ */
#define SIG_BLOCK 1 /* for blocking signals */
diff -urN linux-2.4.26-pre5/include/asm-mips64/signal.h linux-2.4.26-pre5-netdev-core/include/asm-mips64/signal.h
--- linux-2.4.26-pre5/include/asm-mips64/signal.h Sat Sep 13 07:57:32 2003
+++ linux-2.4.26-pre5-netdev-core/include/asm-mips64/signal.h Sun Mar 21 10:16:14 2004
@@ -119,6 +119,12 @@
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x02000000
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
+#endif
+
#endif /* __KERNEL__ */
#define SIG_BLOCK 1 /* for blocking signals */
diff -urN linux-2.4.26-pre5/include/asm-parisc/signal.h linux-2.4.26-pre5-netdev-core/include/asm-parisc/signal.h
--- linux-2.4.26-pre5/include/asm-parisc/signal.h Sun Jan 11 18:48:21 2004
+++ linux-2.4.26-pre5-netdev-core/include/asm-parisc/signal.h Sun Mar 21 10:16:14 2004
@@ -100,6 +100,12 @@
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
+#endif
+
#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
diff -urN linux-2.4.26-pre5/include/asm-ppc/signal.h linux-2.4.26-pre5-netdev-core/include/asm-ppc/signal.h
--- linux-2.4.26-pre5/include/asm-ppc/signal.h Sat Sep 13 07:57:32 2003
+++ linux-2.4.26-pre5-netdev-core/include/asm-ppc/signal.h Sun Mar 21 10:16:14 2004
@@ -111,6 +111,13 @@
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
+#endif
+
#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
diff -urN linux-2.4.26-pre5/include/asm-s390/signal.h linux-2.4.26-pre5-netdev-core/include/asm-s390/signal.h
--- linux-2.4.26-pre5/include/asm-s390/signal.h Fri Feb 20 07:38:34 2004
+++ linux-2.4.26-pre5-netdev-core/include/asm-s390/signal.h Sun Mar 21 10:16:14 2004
@@ -129,7 +129,14 @@
#define SA_SHIRQ 0x04000000
#define SA_DOPATHGROUP 0x00100000
#define SA_FORCE 0x00200000
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
#endif
+
+#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
diff -urN linux-2.4.26-pre5/include/asm-s390x/signal.h linux-2.4.26-pre5-netdev-core/include/asm-s390x/signal.h
--- linux-2.4.26-pre5/include/asm-s390x/signal.h Fri Feb 20 07:38:34 2004
+++ linux-2.4.26-pre5-netdev-core/include/asm-s390x/signal.h Sun Mar 21 10:16:14 2004
@@ -129,7 +129,14 @@
#define SA_SHIRQ 0x04000000
#define SA_DOPATHGROUP 0x00100000
#define SA_FORCE 0x00200000
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
#endif
+
+#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
diff -urN linux-2.4.26-pre5/include/asm-sh/signal.h linux-2.4.26-pre5-netdev-core/include/asm-sh/signal.h
--- linux-2.4.26-pre5/include/asm-sh/signal.h Sat Dec 1 18:27:13 2001
+++ linux-2.4.26-pre5-netdev-core/include/asm-sh/signal.h Sun Mar 21 10:16:14 2004
@@ -107,7 +107,14 @@
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
#endif
+
+#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
diff -urN linux-2.4.26-pre5/include/asm-sparc/signal.h linux-2.4.26-pre5-netdev-core/include/asm-sparc/signal.h
--- linux-2.4.26-pre5/include/asm-sparc/signal.h Sat Dec 1 18:27:14 2001
+++ linux-2.4.26-pre5-netdev-core/include/asm-sparc/signal.h Sun Mar 21 10:16:14 2004
@@ -176,7 +176,14 @@
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_STATIC_ALLOC 0x80
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
#endif
+
+#endif /* __KERNEL__ */
/* Type of a signal handler. */
#ifdef __KERNEL__
diff -urN linux-2.4.26-pre5/include/asm-sparc64/signal.h linux-2.4.26-pre5-netdev-core/include/asm-sparc64/signal.h
--- linux-2.4.26-pre5/include/asm-sparc64/signal.h Sat Dec 1 18:27:14 2001
+++ linux-2.4.26-pre5-netdev-core/include/asm-sparc64/signal.h Sun Mar 21 10:16:14 2004
@@ -192,7 +192,14 @@
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_STATIC_ALLOC 0x80
+
+#ifdef CONFIG_NET_RANDOM
+#define SA_NET_RANDOM SA_SAMPLE_RANDOM
+#else
+#define SA_NET_RANDOM 0
#endif
+
+#endif /* __KERNEL__ */
/* Type of a signal handler. */
#ifdef __KERNEL__

View File

@@ -1,11 +0,0 @@
--- linux-2.4.30.old/drivers/net/et/et_linux.c 2005-05-05 02:53:35.000000000 +0200
+++ linux-2.4.30/drivers/net/et/et_linux.c 2005-05-05 02:54:01.000000000 +0200
@@ -192,7 +192,7 @@
#endif
/* register our interrupt handler */
- if (request_irq(pdev->irq, et_isr, SA_SHIRQ, dev->name, et)) {
+ if (request_irq(pdev->irq, et_isr, SA_SHIRQ | SA_NET_RANDOM, dev->name, et)) {
ET_ERROR(("et%d: request_irq() failed\n", unit));
goto fail;
}

View File

@@ -1,887 +0,0 @@
This patch adds LZMA support to the squashfs code, you should also
change mksquashfs appropriately.
Oleg I. Vdovikin <oleg@cs.msu.su>
--- linuz/fs/squashfs/inode.c 2004-12-15 22:56:47.000000000 +0300
+++ linux/fs/squashfs/inode.c 2005-01-20 20:27:27.490010968 +0300
@@ -3,6 +3,9 @@
*
* Copyright (c) 2002, 2003, 2004 Phillip Lougher <plougher@users.sourceforge.net>
*
+ * LZMA decompressor support added by Oleg I. Vdovikin
+ * Copyright (c) 2005 Oleg I.Vdovikin <oleg@cs.msu.su>
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2,
@@ -21,7 +24,11 @@
* inode.c
*/
+#define SQUASHFS_LZMA
+
+#ifndef SQUASHFS_LZMA
#define SQUASHFS_1_0_COMPATIBILITY
+#endif
#include <linux/types.h>
#include <linux/squashfs_fs.h>
@@ -39,6 +46,19 @@
#include <linux/blkdev.h>
#include <linux/vmalloc.h>
+#ifdef SQUASHFS_LZMA
+#include "LzmaDecode.h"
+
+/* default LZMA settings, should be in sync with mksquashfs */
+#define LZMA_LC 3
+#define LZMA_LP 0
+#define LZMA_PB 2
+
+#define LZMA_WORKSPACE_SIZE ((LZMA_BASE_SIZE + \
+ (LZMA_LIT_SIZE << (LZMA_LC + LZMA_LP))) * sizeof(CProb))
+
+#endif
+
#ifdef SQUASHFS_TRACE
#define TRACE(s, args...) printk(KERN_NOTICE "SQUASHFS: "s, ## args)
#else
@@ -77,7 +97,11 @@
DECLARE_MUTEX(read_data_mutex);
+#ifdef SQUASHFS_LZMA
+static unsigned char lzma_workspace[LZMA_WORKSPACE_SIZE];
+#else
static z_stream stream;
+#endif
static DECLARE_FSTYPE_DEV(squashfs_fs_type, "squashfs", squashfs_read_super);
@@ -232,6 +256,15 @@
if(compressed) {
int zlib_err;
+#ifdef SQUASHFS_LZMA
+ if ((zlib_err = LzmaDecode(lzma_workspace,
+ LZMA_WORKSPACE_SIZE, LZMA_LC, LZMA_LP, LZMA_PB,
+ c_buffer, c_byte, buffer, msBlk->read_size, &bytes)) != LZMA_RESULT_OK)
+ {
+ ERROR("lzma returned unexpected result 0x%x\n", zlib_err);
+ bytes = 0;
+ }
+#else
stream.next_in = c_buffer;
stream.avail_in = c_byte;
stream.next_out = buffer;
@@ -243,6 +276,7 @@
bytes = 0;
} else
bytes = stream.total_out;
+#endif
up(&read_data_mutex);
}
@@ -1491,17 +1525,21 @@
static int __init init_squashfs_fs(void)
{
+#ifndef SQUASHFS_LZMA
if(!(stream.workspace = (char *) vmalloc(zlib_inflate_workspacesize()))) {
ERROR("Failed to allocate zlib workspace\n");
return -ENOMEM;
}
+#endif
return register_filesystem(&squashfs_fs_type);
}
static void __exit exit_squashfs_fs(void)
{
+#ifndef SQUASHFS_LZMA
vfree(stream.workspace);
+#endif
unregister_filesystem(&squashfs_fs_type);
}
--- linuz/fs/squashfs/LzmaDecode.c 1970-01-01 03:00:00.000000000 +0300
+++ linux/fs/squashfs/LzmaDecode.c 2005-01-20 19:40:35.400513552 +0300
@@ -0,0 +1,663 @@
+/*
+ LzmaDecode.c
+ LZMA Decoder
+
+ LZMA SDK 4.05 Copyright (c) 1999-2004 Igor Pavlov (2004-08-25)
+ http://www.7-zip.org/
+
+ LZMA SDK is licensed under two licenses:
+ 1) GNU Lesser General Public License (GNU LGPL)
+ 2) Common Public License (CPL)
+ It means that you can select one of these two licenses and
+ follow rules of that license.
+
+ SPECIAL EXCEPTION:
+ Igor Pavlov, as the author of this code, expressly permits you to
+ statically or dynamically link your code (or bind by name) to the
+ interfaces of this file without subjecting your linked code to the
+ terms of the CPL or GNU LGPL. Any modifications or additions
+ to this file, however, are subject to the LGPL or CPL terms.
+*/
+
+#include "LzmaDecode.h"
+
+#ifndef Byte
+#define Byte unsigned char
+#endif
+
+#define kNumTopBits 24
+#define kTopValue ((UInt32)1 << kNumTopBits)
+
+#define kNumBitModelTotalBits 11
+#define kBitModelTotal (1 << kNumBitModelTotalBits)
+#define kNumMoveBits 5
+
+typedef struct _CRangeDecoder
+{
+ Byte *Buffer;
+ Byte *BufferLim;
+ UInt32 Range;
+ UInt32 Code;
+ #ifdef _LZMA_IN_CB
+ ILzmaInCallback *InCallback;
+ int Result;
+ #endif
+ int ExtraBytes;
+} CRangeDecoder;
+
+Byte RangeDecoderReadByte(CRangeDecoder *rd)
+{
+ if (rd->Buffer == rd->BufferLim)
+ {
+ #ifdef _LZMA_IN_CB
+ UInt32 size;
+ rd->Result = rd->InCallback->Read(rd->InCallback, &rd->Buffer, &size);
+ rd->BufferLim = rd->Buffer + size;
+ if (size == 0)
+ #endif
+ {
+ rd->ExtraBytes = 1;
+ return 0xFF;
+ }
+ }
+ return (*rd->Buffer++);
+}
+
+/* #define ReadByte (*rd->Buffer++) */
+#define ReadByte (RangeDecoderReadByte(rd))
+
+void RangeDecoderInit(CRangeDecoder *rd,
+ #ifdef _LZMA_IN_CB
+ ILzmaInCallback *inCallback
+ #else
+ Byte *stream, UInt32 bufferSize
+ #endif
+ )
+{
+ int i;
+ #ifdef _LZMA_IN_CB
+ rd->InCallback = inCallback;
+ rd->Buffer = rd->BufferLim = 0;
+ #else
+ rd->Buffer = stream;
+ rd->BufferLim = stream + bufferSize;
+ #endif
+ rd->ExtraBytes = 0;
+ rd->Code = 0;
+ rd->Range = (0xFFFFFFFF);
+ for(i = 0; i < 5; i++)
+ rd->Code = (rd->Code << 8) | ReadByte;
+}
+
+#define RC_INIT_VAR UInt32 range = rd->Range; UInt32 code = rd->Code;
+#define RC_FLUSH_VAR rd->Range = range; rd->Code = code;
+#define RC_NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | ReadByte; }
+
+UInt32 RangeDecoderDecodeDirectBits(CRangeDecoder *rd, int numTotalBits)
+{
+ RC_INIT_VAR
+ UInt32 result = 0;
+ int i;
+ for (i = numTotalBits; i > 0; i--)
+ {
+ /* UInt32 t; */
+ range >>= 1;
+
+ result <<= 1;
+ if (code >= range)
+ {
+ code -= range;
+ result |= 1;
+ }
+ /*
+ t = (code - range) >> 31;
+ t &= 1;
+ code -= range & (t - 1);
+ result = (result + result) | (1 - t);
+ */
+ RC_NORMALIZE
+ }
+ RC_FLUSH_VAR
+ return result;
+}
+
+int RangeDecoderBitDecode(CProb *prob, CRangeDecoder *rd)
+{
+ UInt32 bound = (rd->Range >> kNumBitModelTotalBits) * *prob;
+ if (rd->Code < bound)
+ {
+ rd->Range = bound;
+ *prob += (kBitModelTotal - *prob) >> kNumMoveBits;
+ if (rd->Range < kTopValue)
+ {
+ rd->Code = (rd->Code << 8) | ReadByte;
+ rd->Range <<= 8;
+ }
+ return 0;
+ }
+ else
+ {
+ rd->Range -= bound;
+ rd->Code -= bound;
+ *prob -= (*prob) >> kNumMoveBits;
+ if (rd->Range < kTopValue)
+ {
+ rd->Code = (rd->Code << 8) | ReadByte;
+ rd->Range <<= 8;
+ }
+ return 1;
+ }
+}
+
+#define RC_GET_BIT2(prob, mi, A0, A1) \
+ UInt32 bound = (range >> kNumBitModelTotalBits) * *prob; \
+ if (code < bound) \
+ { A0; range = bound; *prob += (kBitModelTotal - *prob) >> kNumMoveBits; mi <<= 1; } \
+ else \
+ { A1; range -= bound; code -= bound; *prob -= (*prob) >> kNumMoveBits; mi = (mi + mi) + 1; } \
+ RC_NORMALIZE
+
+#define RC_GET_BIT(prob, mi) RC_GET_BIT2(prob, mi, ; , ;)
+
+int RangeDecoderBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder *rd)
+{
+ int mi = 1;
+ int i;
+ #ifdef _LZMA_LOC_OPT
+ RC_INIT_VAR
+ #endif
+ for(i = numLevels; i > 0; i--)
+ {
+ #ifdef _LZMA_LOC_OPT
+ CProb *prob = probs + mi;
+ RC_GET_BIT(prob, mi)
+ #else
+ mi = (mi + mi) + RangeDecoderBitDecode(probs + mi, rd);
+ #endif
+ }
+ #ifdef _LZMA_LOC_OPT
+ RC_FLUSH_VAR
+ #endif
+ return mi - (1 << numLevels);
+}
+
+int RangeDecoderReverseBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder *rd)
+{
+ int mi = 1;
+ int i;
+ int symbol = 0;
+ #ifdef _LZMA_LOC_OPT
+ RC_INIT_VAR
+ #endif
+ for(i = 0; i < numLevels; i++)
+ {
+ #ifdef _LZMA_LOC_OPT
+ CProb *prob = probs + mi;
+ RC_GET_BIT2(prob, mi, ; , symbol |= (1 << i))
+ #else
+ int bit = RangeDecoderBitDecode(probs + mi, rd);
+ mi = mi + mi + bit;
+ symbol |= (bit << i);
+ #endif
+ }
+ #ifdef _LZMA_LOC_OPT
+ RC_FLUSH_VAR
+ #endif
+ return symbol;
+}
+
+Byte LzmaLiteralDecode(CProb *probs, CRangeDecoder *rd)
+{
+ int symbol = 1;
+ #ifdef _LZMA_LOC_OPT
+ RC_INIT_VAR
+ #endif
+ do
+ {
+ #ifdef _LZMA_LOC_OPT
+ CProb *prob = probs + symbol;
+ RC_GET_BIT(prob, symbol)
+ #else
+ symbol = (symbol + symbol) | RangeDecoderBitDecode(probs + symbol, rd);
+ #endif
+ }
+ while (symbol < 0x100);
+ #ifdef _LZMA_LOC_OPT
+ RC_FLUSH_VAR
+ #endif
+ return symbol;
+}
+
+Byte LzmaLiteralDecodeMatch(CProb *probs, CRangeDecoder *rd, Byte matchByte)
+{
+ int symbol = 1;
+ #ifdef _LZMA_LOC_OPT
+ RC_INIT_VAR
+ #endif
+ do
+ {
+ int bit;
+ int matchBit = (matchByte >> 7) & 1;
+ matchByte <<= 1;
+ #ifdef _LZMA_LOC_OPT
+ {
+ CProb *prob = probs + ((1 + matchBit) << 8) + symbol;
+ RC_GET_BIT2(prob, symbol, bit = 0, bit = 1)
+ }
+ #else
+ bit = RangeDecoderBitDecode(probs + ((1 + matchBit) << 8) + symbol, rd);
+ symbol = (symbol << 1) | bit;
+ #endif
+ if (matchBit != bit)
+ {
+ while (symbol < 0x100)
+ {
+ #ifdef _LZMA_LOC_OPT
+ CProb *prob = probs + symbol;
+ RC_GET_BIT(prob, symbol)
+ #else
+ symbol = (symbol + symbol) | RangeDecoderBitDecode(probs + symbol, rd);
+ #endif
+ }
+ break;
+ }
+ }
+ while (symbol < 0x100);
+ #ifdef _LZMA_LOC_OPT
+ RC_FLUSH_VAR
+ #endif
+ return symbol;
+}
+
+#define kNumPosBitsMax 4
+#define kNumPosStatesMax (1 << kNumPosBitsMax)
+
+#define kLenNumLowBits 3
+#define kLenNumLowSymbols (1 << kLenNumLowBits)
+#define kLenNumMidBits 3
+#define kLenNumMidSymbols (1 << kLenNumMidBits)
+#define kLenNumHighBits 8
+#define kLenNumHighSymbols (1 << kLenNumHighBits)
+
+#define LenChoice 0
+#define LenChoice2 (LenChoice + 1)
+#define LenLow (LenChoice2 + 1)
+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
+
+int LzmaLenDecode(CProb *p, CRangeDecoder *rd, int posState)
+{
+ if(RangeDecoderBitDecode(p + LenChoice, rd) == 0)
+ return RangeDecoderBitTreeDecode(p + LenLow +
+ (posState << kLenNumLowBits), kLenNumLowBits, rd);
+ if(RangeDecoderBitDecode(p + LenChoice2, rd) == 0)
+ return kLenNumLowSymbols + RangeDecoderBitTreeDecode(p + LenMid +
+ (posState << kLenNumMidBits), kLenNumMidBits, rd);
+ return kLenNumLowSymbols + kLenNumMidSymbols +
+ RangeDecoderBitTreeDecode(p + LenHigh, kLenNumHighBits, rd);
+}
+
+#define kNumStates 12
+
+#define kStartPosModelIndex 4
+#define kEndPosModelIndex 14
+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
+
+#define kNumPosSlotBits 6
+#define kNumLenToPosStates 4
+
+#define kNumAlignBits 4
+#define kAlignTableSize (1 << kNumAlignBits)
+
+#define kMatchMinLen 2
+
+#define IsMatch 0
+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
+#define IsRepG0 (IsRep + kNumStates)
+#define IsRepG1 (IsRepG0 + kNumStates)
+#define IsRepG2 (IsRepG1 + kNumStates)
+#define IsRep0Long (IsRepG2 + kNumStates)
+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
+#define LenCoder (Align + kAlignTableSize)
+#define RepLenCoder (LenCoder + kNumLenProbs)
+#define Literal (RepLenCoder + kNumLenProbs)
+
+#if Literal != LZMA_BASE_SIZE
+StopCompilingDueBUG
+#endif
+
+#ifdef _LZMA_OUT_READ
+
+typedef struct _LzmaVarState
+{
+ CRangeDecoder RangeDecoder;
+ Byte *Dictionary;
+ UInt32 DictionarySize;
+ UInt32 DictionaryPos;
+ UInt32 GlobalPos;
+ UInt32 Reps[4];
+ int lc;
+ int lp;
+ int pb;
+ int State;
+ int PreviousIsMatch;
+ int RemainLen;
+} LzmaVarState;
+
+int LzmaDecoderInit(
+ unsigned char *buffer, UInt32 bufferSize,
+ int lc, int lp, int pb,
+ unsigned char *dictionary, UInt32 dictionarySize,
+ #ifdef _LZMA_IN_CB
+ ILzmaInCallback *inCallback
+ #else
+ unsigned char *inStream, UInt32 inSize
+ #endif
+ )
+{
+ LzmaVarState *vs = (LzmaVarState *)buffer;
+ CProb *p = (CProb *)(buffer + sizeof(LzmaVarState));
+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + lp));
+ UInt32 i;
+ if (bufferSize < numProbs * sizeof(CProb) + sizeof(LzmaVarState))
+ return LZMA_RESULT_NOT_ENOUGH_MEM;
+ vs->Dictionary = dictionary;
+ vs->DictionarySize = dictionarySize;
+ vs->DictionaryPos = 0;
+ vs->GlobalPos = 0;
+ vs->Reps[0] = vs->Reps[1] = vs->Reps[2] = vs->Reps[3] = 1;
+ vs->lc = lc;
+ vs->lp = lp;
+ vs->pb = pb;
+ vs->State = 0;
+ vs->PreviousIsMatch = 0;
+ vs->RemainLen = 0;
+ dictionary[dictionarySize - 1] = 0;
+ for (i = 0; i < numProbs; i++)
+ p[i] = kBitModelTotal >> 1;
+ RangeDecoderInit(&vs->RangeDecoder,
+ #ifdef _LZMA_IN_CB
+ inCallback
+ #else
+ inStream, inSize
+ #endif
+ );
+ return LZMA_RESULT_OK;
+}
+
+int LzmaDecode(unsigned char *buffer,
+ unsigned char *outStream, UInt32 outSize,
+ UInt32 *outSizeProcessed)
+{
+ LzmaVarState *vs = (LzmaVarState *)buffer;
+ CProb *p = (CProb *)(buffer + sizeof(LzmaVarState));
+ CRangeDecoder rd = vs->RangeDecoder;
+ int state = vs->State;
+ int previousIsMatch = vs->PreviousIsMatch;
+ Byte previousByte;
+ UInt32 rep0 = vs->Reps[0], rep1 = vs->Reps[1], rep2 = vs->Reps[2], rep3 = vs->Reps[3];
+ UInt32 nowPos = 0;
+ UInt32 posStateMask = (1 << (vs->pb)) - 1;
+ UInt32 literalPosMask = (1 << (vs->lp)) - 1;
+ int lc = vs->lc;
+ int len = vs->RemainLen;
+ UInt32 globalPos = vs->GlobalPos;
+
+ Byte *dictionary = vs->Dictionary;
+ UInt32 dictionarySize = vs->DictionarySize;
+ UInt32 dictionaryPos = vs->DictionaryPos;
+
+ if (len == -1)
+ {
+ *outSizeProcessed = 0;
+ return LZMA_RESULT_OK;
+ }
+
+ while(len > 0 && nowPos < outSize)
+ {
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ outStream[nowPos++] = dictionary[dictionaryPos] = dictionary[pos];
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ len--;
+ }
+ if (dictionaryPos == 0)
+ previousByte = dictionary[dictionarySize - 1];
+ else
+ previousByte = dictionary[dictionaryPos - 1];
+#else
+
+int LzmaDecode(
+ Byte *buffer, UInt32 bufferSize,
+ int lc, int lp, int pb,
+ #ifdef _LZMA_IN_CB
+ ILzmaInCallback *inCallback,
+ #else
+ unsigned char *inStream, UInt32 inSize,
+ #endif
+ unsigned char *outStream, UInt32 outSize,
+ UInt32 *outSizeProcessed)
+{
+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + lp));
+ CProb *p = (CProb *)buffer;
+ CRangeDecoder rd;
+ UInt32 i;
+ int state = 0;
+ int previousIsMatch = 0;
+ Byte previousByte = 0;
+ UInt32 rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1;
+ UInt32 nowPos = 0;
+ UInt32 posStateMask = (1 << pb) - 1;
+ UInt32 literalPosMask = (1 << lp) - 1;
+ int len = 0;
+ if (bufferSize < numProbs * sizeof(CProb))
+ return LZMA_RESULT_NOT_ENOUGH_MEM;
+ for (i = 0; i < numProbs; i++)
+ p[i] = kBitModelTotal >> 1;
+ RangeDecoderInit(&rd,
+ #ifdef _LZMA_IN_CB
+ inCallback
+ #else
+ inStream, inSize
+ #endif
+ );
+#endif
+
+ *outSizeProcessed = 0;
+ while(nowPos < outSize)
+ {
+ int posState = (int)(
+ (nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
+ )
+ & posStateMask);
+ #ifdef _LZMA_IN_CB
+ if (rd.Result != LZMA_RESULT_OK)
+ return rd.Result;
+ #endif
+ if (rd.ExtraBytes != 0)
+ return LZMA_RESULT_DATA_ERROR;
+ if (RangeDecoderBitDecode(p + IsMatch + (state << kNumPosBitsMax) + posState, &rd) == 0)
+ {
+ CProb *probs = p + Literal + (LZMA_LIT_SIZE *
+ (((
+ (nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
+ )
+ & literalPosMask) << lc) + (previousByte >> (8 - lc))));
+
+ if (state < 4) state = 0;
+ else if (state < 10) state -= 3;
+ else state -= 6;
+ if (previousIsMatch)
+ {
+ Byte matchByte;
+ #ifdef _LZMA_OUT_READ
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ matchByte = dictionary[pos];
+ #else
+ matchByte = outStream[nowPos - rep0];
+ #endif
+ previousByte = LzmaLiteralDecodeMatch(probs, &rd, matchByte);
+ previousIsMatch = 0;
+ }
+ else
+ previousByte = LzmaLiteralDecode(probs, &rd);
+ outStream[nowPos++] = previousByte;
+ #ifdef _LZMA_OUT_READ
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ #endif
+ }
+ else
+ {
+ previousIsMatch = 1;
+ if (RangeDecoderBitDecode(p + IsRep + state, &rd) == 1)
+ {
+ if (RangeDecoderBitDecode(p + IsRepG0 + state, &rd) == 0)
+ {
+ if (RangeDecoderBitDecode(p + IsRep0Long + (state << kNumPosBitsMax) + posState, &rd) == 0)
+ {
+ #ifdef _LZMA_OUT_READ
+ UInt32 pos;
+ #endif
+ if (
+ (nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
+ )
+ == 0)
+ return LZMA_RESULT_DATA_ERROR;
+ state = state < 7 ? 9 : 11;
+ #ifdef _LZMA_OUT_READ
+ pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ previousByte = dictionary[pos];
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ #else
+ previousByte = outStream[nowPos - rep0];
+ #endif
+ outStream[nowPos++] = previousByte;
+ continue;
+ }
+ }
+ else
+ {
+ UInt32 distance;
+ if(RangeDecoderBitDecode(p + IsRepG1 + state, &rd) == 0)
+ distance = rep1;
+ else
+ {
+ if(RangeDecoderBitDecode(p + IsRepG2 + state, &rd) == 0)
+ distance = rep2;
+ else
+ {
+ distance = rep3;
+ rep3 = rep2;
+ }
+ rep2 = rep1;
+ }
+ rep1 = rep0;
+ rep0 = distance;
+ }
+ len = LzmaLenDecode(p + RepLenCoder, &rd, posState);
+ state = state < 7 ? 8 : 11;
+ }
+ else
+ {
+ int posSlot;
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ state = state < 7 ? 7 : 10;
+ len = LzmaLenDecode(p + LenCoder, &rd, posState);
+ posSlot = RangeDecoderBitTreeDecode(p + PosSlot +
+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
+ kNumPosSlotBits), kNumPosSlotBits, &rd);
+ if (posSlot >= kStartPosModelIndex)
+ {
+ int numDirectBits = ((posSlot >> 1) - 1);
+ rep0 = ((2 | ((UInt32)posSlot & 1)) << numDirectBits);
+ if (posSlot < kEndPosModelIndex)
+ {
+ rep0 += RangeDecoderReverseBitTreeDecode(
+ p + SpecPos + rep0 - posSlot - 1, numDirectBits, &rd);
+ }
+ else
+ {
+ rep0 += RangeDecoderDecodeDirectBits(&rd,
+ numDirectBits - kNumAlignBits) << kNumAlignBits;
+ rep0 += RangeDecoderReverseBitTreeDecode(p + Align, kNumAlignBits, &rd);
+ }
+ }
+ else
+ rep0 = posSlot;
+ rep0++;
+ }
+ if (rep0 == (UInt32)(0))
+ {
+ /* it's for stream version */
+ len = -1;
+ break;
+ }
+ if (rep0 > nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
+ )
+ {
+ return LZMA_RESULT_DATA_ERROR;
+ }
+ len += kMatchMinLen;
+ do
+ {
+ #ifdef _LZMA_OUT_READ
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ previousByte = dictionary[pos];
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ #else
+ previousByte = outStream[nowPos - rep0];
+ #endif
+ outStream[nowPos++] = previousByte;
+ len--;
+ }
+ while(len > 0 && nowPos < outSize);
+ }
+ }
+
+ #ifdef _LZMA_OUT_READ
+ vs->RangeDecoder = rd;
+ vs->DictionaryPos = dictionaryPos;
+ vs->GlobalPos = globalPos + nowPos;
+ vs->Reps[0] = rep0;
+ vs->Reps[1] = rep1;
+ vs->Reps[2] = rep2;
+ vs->Reps[3] = rep3;
+ vs->State = state;
+ vs->PreviousIsMatch = previousIsMatch;
+ vs->RemainLen = len;
+ #endif
+
+ *outSizeProcessed = nowPos;
+ return LZMA_RESULT_OK;
+}
--- linuz/fs/squashfs/LzmaDecode.h 1970-01-01 03:00:00.000000000 +0300
+++ linux/fs/squashfs/LzmaDecode.h 2005-01-20 19:40:36.794301664 +0300
@@ -0,0 +1,100 @@
+/*
+ LzmaDecode.h
+ LZMA Decoder interface
+
+ LZMA SDK 4.05 Copyright (c) 1999-2004 Igor Pavlov (2004-08-25)
+ http://www.7-zip.org/
+
+ LZMA SDK is licensed under two licenses:
+ 1) GNU Lesser General Public License (GNU LGPL)
+ 2) Common Public License (CPL)
+ It means that you can select one of these two licenses and
+ follow rules of that license.
+
+ SPECIAL EXCEPTION:
+ Igor Pavlov, as the author of this code, expressly permits you to
+ statically or dynamically link your code (or bind by name) to the
+ interfaces of this file without subjecting your linked code to the
+ terms of the CPL or GNU LGPL. Any modifications or additions
+ to this file, however, are subject to the LGPL or CPL terms.
+*/
+
+#ifndef __LZMADECODE_H
+#define __LZMADECODE_H
+
+/* #define _LZMA_IN_CB */
+/* Use callback for input data */
+
+/* #define _LZMA_OUT_READ */
+/* Use read function for output data */
+
+/* #define _LZMA_PROB32 */
+/* It can increase speed on some 32-bit CPUs,
+ but memory usage will be doubled in that case */
+
+/* #define _LZMA_LOC_OPT */
+/* Enable local speed optimizations inside code */
+
+#ifndef UInt32
+#ifdef _LZMA_UINT32_IS_ULONG
+#define UInt32 unsigned long
+#else
+#define UInt32 unsigned int
+#endif
+#endif
+
+#ifdef _LZMA_PROB32
+#define CProb UInt32
+#else
+#define CProb unsigned short
+#endif
+
+#define LZMA_RESULT_OK 0
+#define LZMA_RESULT_DATA_ERROR 1
+#define LZMA_RESULT_NOT_ENOUGH_MEM 2
+
+#ifdef _LZMA_IN_CB
+typedef struct _ILzmaInCallback
+{
+ int (*Read)(void *object, unsigned char **buffer, UInt32 *bufferSize);
+} ILzmaInCallback;
+#endif
+
+#define LZMA_BASE_SIZE 1846
+#define LZMA_LIT_SIZE 768
+
+/*
+bufferSize = (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)))* sizeof(CProb)
+bufferSize += 100 in case of _LZMA_OUT_READ
+by default CProb is unsigned short,
+but if specify _LZMA_PROB_32, CProb will be UInt32(unsigned int)
+*/
+
+#ifdef _LZMA_OUT_READ
+int LzmaDecoderInit(
+ unsigned char *buffer, UInt32 bufferSize,
+ int lc, int lp, int pb,
+ unsigned char *dictionary, UInt32 dictionarySize,
+ #ifdef _LZMA_IN_CB
+ ILzmaInCallback *inCallback
+ #else
+ unsigned char *inStream, UInt32 inSize
+ #endif
+);
+#endif
+
+int LzmaDecode(
+ unsigned char *buffer,
+ #ifndef _LZMA_OUT_READ
+ UInt32 bufferSize,
+ int lc, int lp, int pb,
+ #ifdef _LZMA_IN_CB
+ ILzmaInCallback *inCallback,
+ #else
+ unsigned char *inStream, UInt32 inSize,
+ #endif
+ #endif
+ unsigned char *outStream, UInt32 outSize,
+ UInt32 *outSizeProcessed);
+
+#endif
--- linuz/fs/squashfs/Makefile 2004-12-15 22:56:47.000000000 +0300
+++ linux/fs/squashfs/Makefile 2005-01-19 23:04:25.000000000 +0300
@@ -4,7 +4,7 @@
O_TARGET := squashfs.o
-obj-y := inode.o
+obj-y := inode.o LzmaDecode.o
obj-m := $(O_TARGET)

View File

@@ -1,688 +0,0 @@
diff -urPX nopatch linux-2.4.26/Documentation/Configure.help linux/Documentation/Configure.help
--- linux-2.4.26/Documentation/Configure.help Sat Apr 17 02:10:25 2004
+++ linux/Documentation/Configure.help Sat Apr 17 02:13:54 2004
@@ -4622,6 +4622,12 @@
will be called binfmt_elf.o. Saying M or N here is dangerous because
some crucial programs on your system might be in ELF format.
+ELF binaries with a.out format interpreters or a.out libraries
+CONFIG_BINFMT_ELF_AOUT
+ The kernel may support ELF executables which use an a.out format
+ interpreter (dynamic linker) and/or a.out shared libraries, in
+ addition to the usual ELF-ELF setups. You shouldn't need this.
+
Kernel support for a.out binaries
CONFIG_BINFMT_AOUT
A.out (Assembler.OUTput) is a set of formats for libraries and
@@ -4635,13 +4641,11 @@
warrant removing support. However its removal is a good idea if you
wish to ensure that absolutely none of your programs will use this
older executable format. If you don't know what to answer at this
- point then answer Y. If someone told you "You need a kernel with
+ point then answer N. If someone told you "You need a kernel with
QMAGIC support" then you'll have to say Y here. You may answer M to
compile a.out support as a module and later load the module when you
want to use a program or library in a.out format. The module will be
- called binfmt_aout.o. Saying M or N here is dangerous though,
- because some crucial programs on your system might still be in A.OUT
- format.
+ called binfmt_aout.o.
OSF/1 v4 readv/writev compatibility
CONFIG_OSF4_COMPAT
diff -urPX nopatch linux-2.4.26/arch/alpha/config.in linux/arch/alpha/config.in
--- linux-2.4.26/arch/alpha/config.in Fri Feb 20 10:07:20 2004
+++ linux/arch/alpha/config.in Sat Apr 17 02:13:54 2004
@@ -315,6 +315,9 @@
fi
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
tristate 'Kernel support for Linux/Intel ELF binaries' CONFIG_BINFMT_EM86
source drivers/parport/Config.in
diff -urPX nopatch linux-2.4.26/arch/alpha/defconfig linux/arch/alpha/defconfig
--- linux-2.4.26/arch/alpha/defconfig Fri Feb 20 10:07:20 2004
+++ linux/arch/alpha/defconfig Sat Apr 17 02:13:54 2004
@@ -72,6 +72,7 @@
# CONFIG_KCORE_AOUT is not set
# CONFIG_BINFMT_AOUT is not set
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_BINFMT_MISC is not set
# CONFIG_BINFMT_EM86 is not set
diff -urPX nopatch linux-2.4.26/arch/arm/config.in linux/arch/arm/config.in
--- linux-2.4.26/arch/arm/config.in Fri Feb 20 10:07:20 2004
+++ linux/arch/arm/config.in Sat Apr 17 02:13:54 2004
@@ -499,6 +499,9 @@
A.OUT CONFIG_KCORE_AOUT" ELF
tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
dep_bool 'Power Management support (experimental)' CONFIG_PM $CONFIG_EXPERIMENTAL
dep_tristate 'RISC OS personality' CONFIG_ARTHUR $CONFIG_CPU_32
diff -urPX nopatch linux-2.4.26/arch/arm/defconfig linux/arch/arm/defconfig
--- linux-2.4.26/arch/arm/defconfig Fri Feb 20 10:07:21 2004
+++ linux/arch/arm/defconfig Sat Apr 17 02:13:54 2004
@@ -83,8 +83,9 @@
CONFIG_NWFPE=y
CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
-CONFIG_BINFMT_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_BINFMT_MISC is not set
# CONFIG_PM is not set
# CONFIG_ARTHUR is not set
diff -urPX nopatch linux-2.4.26/arch/cris/config.in linux/arch/cris/config.in
--- linux-2.4.26/arch/cris/config.in Fri Feb 20 10:07:21 2004
+++ linux/arch/cris/config.in Sat Apr 17 02:13:54 2004
@@ -31,6 +31,9 @@
bool 'Sysctl support' CONFIG_SYSCTL
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
string 'Kernel command line' CONFIG_ETRAX_CMDLINE "root=/dev/mtdblock3"
diff -urPX nopatch linux-2.4.26/arch/cris/defconfig linux/arch/cris/defconfig
--- linux-2.4.26/arch/cris/defconfig Fri Feb 20 10:07:21 2004
+++ linux/arch/cris/defconfig Sat Apr 17 02:13:54 2004
@@ -18,6 +18,7 @@
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_SYSCTL is not set
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_ETRAX_KGDB is not set
# CONFIG_ETRAX_WATCHDOG is not set
diff -urPX nopatch linux-2.4.26/arch/i386/config.in linux/arch/i386/config.in
--- linux-2.4.26/arch/i386/config.in Fri Feb 20 10:07:21 2004
+++ linux/arch/i386/config.in Sat Apr 17 02:13:54 2004
@@ -327,6 +327,9 @@
fi
tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER
diff -urPX nopatch linux-2.4.26/arch/i386/defconfig linux/arch/i386/defconfig
--- linux-2.4.26/arch/i386/defconfig Sat Apr 17 02:10:25 2004
+++ linux/arch/i386/defconfig Sat Apr 17 02:23:27 2004
@@ -110,9 +110,10 @@
CONFIG_SYSCTL=y
CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
-CONFIG_BINFMT_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
CONFIG_BINFMT_ELF=y
-CONFIG_BINFMT_MISC=y
+# CONFIG_BINFMT_ELF_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
# CONFIG_OOM_KILLER is not set
CONFIG_PM=y
# CONFIG_APM is not set
diff -urPX nopatch linux-2.4.26/arch/ia64/config.in linux/arch/ia64/config.in
--- linux-2.4.26/arch/ia64/config.in Fri Feb 20 10:07:21 2004
+++ linux/arch/ia64/config.in Sat Apr 17 02:13:54 2004
@@ -124,6 +124,9 @@
bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
bool 'Sysctl support' CONFIG_SYSCTL
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
diff -urPX nopatch linux-2.4.26/arch/ia64/defconfig linux/arch/ia64/defconfig
--- linux-2.4.26/arch/ia64/defconfig Fri Feb 20 10:07:21 2004
+++ linux/arch/ia64/defconfig Sat Apr 17 02:13:54 2004
@@ -60,6 +60,7 @@
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_ACPI=y
CONFIG_ACPI_EFI=y
diff -urPX nopatch linux-2.4.26/arch/m68k/config.in linux/arch/m68k/config.in
--- linux-2.4.26/arch/m68k/config.in Fri Feb 20 10:07:22 2004
+++ linux/arch/m68k/config.in Sat Apr 17 02:13:55 2004
@@ -99,6 +99,9 @@
fi
tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
if [ "$CONFIG_AMIGA" = "y" ]; then
diff -urPX nopatch linux-2.4.26/arch/m68k/defconfig linux/arch/m68k/defconfig
--- linux-2.4.26/arch/m68k/defconfig Fri Feb 20 10:07:22 2004
+++ linux/arch/m68k/defconfig Sat Apr 17 02:13:55 2004
@@ -44,8 +44,9 @@
CONFIG_SYSCTL=y
CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
-CONFIG_BINFMT_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_ZORRO=y
# CONFIG_AMIGA_PCMCIA is not set
diff -urPX nopatch linux-2.4.26/arch/mips/config-shared.in linux/arch/mips/config-shared.in
--- linux-2.4.26/arch/mips/config-shared.in Fri Feb 20 10:07:22 2004
+++ linux/arch/mips/config-shared.in Sat Apr 17 02:13:55 2004
@@ -944,6 +944,9 @@
define_bool CONFIG_KCORE_AOUT n
define_bool CONFIG_BINFMT_AOUT n
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
dep_bool 'Kernel support for Linux/MIPS 32-bit binary compatibility' CONFIG_MIPS32_COMPAT $CONFIG_MIPS64
dep_bool 'Kernel support for o32 binaries' CONFIG_MIPS32_O32 $CONFIG_MIPS32_COMPAT
dep_bool 'Kernel support for n32 binaries' CONFIG_MIPS32_N32 $CONFIG_MIPS32_COMPAT
diff -urPX nopatch linux-2.4.26/arch/mips/defconfig linux/arch/mips/defconfig
--- linux-2.4.26/arch/mips/defconfig Fri Feb 20 10:07:22 2004
+++ linux/arch/mips/defconfig Sat Apr 17 02:13:55 2004
@@ -139,6 +139,7 @@
# CONFIG_KCORE_AOUT is not set
# CONFIG_BINFMT_AOUT is not set
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_MIPS32_COMPAT is not set
# CONFIG_MIPS32_O32 is not set
# CONFIG_MIPS32_N32 is not set
diff -urPX nopatch linux-2.4.26/arch/mips/kernel/irixelf.c linux/arch/mips/kernel/irixelf.c
--- linux-2.4.26/arch/mips/kernel/irixelf.c Mon Aug 25 11:44:40 2003
+++ linux/arch/mips/kernel/irixelf.c Sat Apr 17 02:13:55 2004
@@ -8,6 +8,7 @@
* Copyright 1993, 1994: Eric Youngdale (ericy@cais.com).
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/fs.h>
@@ -48,7 +49,12 @@
extern int dump_fpu (elf_fpregset_t *);
static struct linux_binfmt irix_format = {
- NULL, THIS_MODULE, load_irix_binary, load_irix_library,
+ NULL, THIS_MODULE, load_irix_binary,
+#ifdef CONFIG_BINFMT_ELF_AOUT
+ load_irix_library,
+#else
+ NULL,
+#endif
irix_core_dump, PAGE_SIZE
};
@@ -787,6 +793,7 @@
goto out;
}
+#ifdef CONFIG_BINFMT_ELF_AOUT
/* This is really simpleminded and specialized - we are loading an
* a.out library that is given an ELF header.
*/
@@ -863,6 +870,7 @@
kfree(elf_phdata);
return 0;
}
+#endif
/* Called through irix_syssgi() to map an elf image given an FD,
* a phdr ptr USER_PHDRP in userspace, and a count CNT telling how many
diff -urPX nopatch linux-2.4.26/arch/mips64/defconfig linux/arch/mips64/defconfig
--- linux-2.4.26/arch/mips64/defconfig Fri Feb 20 10:07:24 2004
+++ linux/arch/mips64/defconfig Sat Apr 17 02:13:55 2004
@@ -137,6 +137,7 @@
# CONFIG_KCORE_AOUT is not set
# CONFIG_BINFMT_AOUT is not set
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
CONFIG_MIPS32_COMPAT=y
CONFIG_MIPS32_O32=y
# CONFIG_MIPS32_N32 is not set
diff -urPX nopatch linux-2.4.26/arch/parisc/config.in linux/arch/parisc/config.in
--- linux-2.4.26/arch/parisc/config.in Fri Feb 20 10:07:25 2004
+++ linux/arch/parisc/config.in Sat Apr 17 02:13:55 2004
@@ -89,6 +89,9 @@
bool 'Sysctl support' CONFIG_SYSCTL
define_bool CONFIG_KCORE_ELF y
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for SOM binaries' CONFIG_BINFMT_SOM
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
diff -urPX nopatch linux-2.4.26/arch/parisc/defconfig linux/arch/parisc/defconfig
--- linux-2.4.26/arch/parisc/defconfig Fri Feb 20 10:07:25 2004
+++ linux/arch/parisc/defconfig Sat Apr 17 02:13:55 2004
@@ -56,6 +56,7 @@
CONFIG_SYSCTL=y
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
CONFIG_BINFMT_SOM=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_PM is not set
diff -urPX nopatch linux-2.4.26/arch/ppc/config.in linux/arch/ppc/config.in
--- linux-2.4.26/arch/ppc/config.in Sat Apr 17 02:10:25 2004
+++ linux/arch/ppc/config.in Sat Apr 17 02:13:55 2004
@@ -384,6 +384,7 @@
fi
define_bool CONFIG_BINFMT_ELF y
define_bool CONFIG_KERNEL_ELF y
+bool 'ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER
diff -urPX nopatch linux-2.4.26/arch/ppc/defconfig linux/arch/ppc/defconfig
--- linux-2.4.26/arch/ppc/defconfig Fri Feb 20 10:07:25 2004
+++ linux/arch/ppc/defconfig Sat Apr 17 02:13:55 2004
@@ -59,7 +59,8 @@
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
CONFIG_KERNEL_ELF=y
-CONFIG_BINFMT_MISC=m
+# CONFIG_BINFMT_ELF_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
# CONFIG_OOM_KILLER is not set
CONFIG_PCI_NAMES=y
CONFIG_HOTPLUG=y
diff -urPX nopatch linux-2.4.26/arch/ppc64/config.in linux/arch/ppc64/config.in
--- linux-2.4.26/arch/ppc64/config.in Fri Feb 20 10:07:25 2004
+++ linux/arch/ppc64/config.in Sat Apr 17 02:13:55 2004
@@ -82,6 +82,9 @@
fi
bool 'Kernel support for 64 bit ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for 32 bit ELF binaries' CONFIG_BINFMT_ELF32
diff -urPX nopatch linux-2.4.26/arch/ppc64/defconfig linux/arch/ppc64/defconfig
--- linux-2.4.26/arch/ppc64/defconfig Fri Feb 20 10:07:25 2004
+++ linux/arch/ppc64/defconfig Sat Apr 17 02:13:55 2004
@@ -56,6 +56,7 @@
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_MISC is not set
CONFIG_PCI_NAMES=y
diff -urPX nopatch linux-2.4.26/arch/s390/config.in linux/arch/s390/config.in
--- linux-2.4.26/arch/s390/config.in Fri Nov 28 18:26:19 2003
+++ linux/arch/s390/config.in Sat Apr 17 02:13:55 2004
@@ -58,6 +58,9 @@
bool 'Sysctl support' CONFIG_SYSCTL
define_bool CONFIG_KCORE_ELF y
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
bool 'Show crashed user process info' CONFIG_PROCESS_DEBUG
bool 'Pseudo page fault support' CONFIG_PFAULT
diff -urPX nopatch linux-2.4.26/arch/s390/defconfig linux/arch/s390/defconfig
--- linux-2.4.26/arch/s390/defconfig Fri Feb 20 10:07:26 2004
+++ linux/arch/s390/defconfig Sat Apr 17 02:13:55 2004
@@ -46,6 +46,7 @@
CONFIG_SYSCTL=y
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_BINFMT_MISC is not set
# CONFIG_PROCESS_DEBUG is not set
CONFIG_PFAULT=y
diff -urPX nopatch linux-2.4.26/arch/s390x/config.in linux/arch/s390x/config.in
--- linux-2.4.26/arch/s390x/config.in Fri Nov 28 18:26:19 2003
+++ linux/arch/s390x/config.in Sat Apr 17 02:13:55 2004
@@ -61,6 +61,9 @@
bool 'Sysctl support' CONFIG_SYSCTL
define_bool CONFIG_KCORE_ELF y
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
bool 'Show crashed user process info' CONFIG_PROCESS_DEBUG
bool 'Pseudo page fault support' CONFIG_PFAULT
diff -urPX nopatch linux-2.4.26/arch/s390x/defconfig linux/arch/s390x/defconfig
--- linux-2.4.26/arch/s390x/defconfig Fri Feb 20 10:07:26 2004
+++ linux/arch/s390x/defconfig Sat Apr 17 02:13:55 2004
@@ -47,6 +47,7 @@
CONFIG_SYSCTL=y
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_BINFMT_MISC is not set
# CONFIG_PROCESS_DEBUG is not set
CONFIG_PFAULT=y
diff -urPX nopatch linux-2.4.26/arch/sh/config.in linux/arch/sh/config.in
--- linux-2.4.26/arch/sh/config.in Fri Feb 20 10:07:26 2004
+++ linux/arch/sh/config.in Sat Apr 17 02:13:55 2004
@@ -283,6 +283,9 @@
A.OUT CONFIG_KCORE_AOUT" ELF
fi
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER
diff -urPX nopatch linux-2.4.26/arch/sh/defconfig linux/arch/sh/defconfig
--- linux-2.4.26/arch/sh/defconfig Fri Feb 20 10:07:26 2004
+++ linux/arch/sh/defconfig Sat Apr 17 02:13:55 2004
@@ -48,6 +48,7 @@
CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_BINFMT_MISC is not set
#
diff -urPX nopatch linux-2.4.26/arch/sparc/config.in linux/arch/sparc/config.in
--- linux-2.4.26/arch/sparc/config.in Fri Feb 20 10:07:26 2004
+++ linux/arch/sparc/config.in Sat Apr 17 02:13:55 2004
@@ -74,6 +74,9 @@
fi
tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
bool 'SunOS binary emulation' CONFIG_SUNOS_EMUL
bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER
diff -urPX nopatch linux-2.4.26/arch/sparc/defconfig linux/arch/sparc/defconfig
--- linux-2.4.26/arch/sparc/defconfig Sat Apr 17 02:10:25 2004
+++ linux/arch/sparc/defconfig Sat Apr 17 02:13:55 2004
@@ -49,9 +49,10 @@
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
CONFIG_KCORE_ELF=y
-CONFIG_BINFMT_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
CONFIG_BINFMT_ELF=y
-CONFIG_BINFMT_MISC=m
+# CONFIG_BINFMT_ELF_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
CONFIG_SUNOS_EMUL=y
# CONFIG_OOM_KILLER is not set
diff -urPX nopatch linux-2.4.26/arch/sparc64/config.in linux/arch/sparc64/config.in
--- linux-2.4.26/arch/sparc64/config.in Fri Feb 20 10:07:26 2004
+++ linux/arch/sparc64/config.in Sat Apr 17 02:13:55 2004
@@ -77,6 +77,9 @@
bool ' Kernel support for 32-bit (ie. SunOS) a.out binaries' CONFIG_BINFMT_AOUT32
fi
bool 'Kernel support for 64-bit ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
bool 'SunOS binary emulation' CONFIG_SUNOS_EMUL
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
diff -urPX nopatch linux-2.4.26/arch/sparc64/defconfig linux/arch/sparc64/defconfig
--- linux-2.4.26/arch/sparc64/defconfig Sat Apr 17 02:10:26 2004
+++ linux/arch/sparc64/defconfig Sat Apr 17 02:13:55 2004
@@ -56,7 +56,8 @@
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_AOUT32 is not set
CONFIG_BINFMT_ELF=y
-CONFIG_BINFMT_MISC=m
+# CONFIG_BINFMT_ELF_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
# CONFIG_SUNOS_EMUL is not set
CONFIG_SOLARIS_EMUL=m
# CONFIG_OOM_KILLER is not set
diff -urPX nopatch linux-2.4.26/arch/x86_64/config.in linux/arch/x86_64/config.in
--- linux-2.4.26/arch/x86_64/config.in Sat Apr 17 02:10:26 2004
+++ linux/arch/x86_64/config.in Sat Apr 17 02:13:55 2004
@@ -118,6 +118,9 @@
fi
#tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
+if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
+ bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
+fi
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
bool 'Power Management support' CONFIG_PM
diff -urPX nopatch linux-2.4.26/arch/x86_64/defconfig linux/arch/x86_64/defconfig
--- linux-2.4.26/arch/x86_64/defconfig Sat Apr 17 02:10:26 2004
+++ linux/arch/x86_64/defconfig Sat Apr 17 02:13:55 2004
@@ -67,6 +67,7 @@
CONFIG_SYSCTL=y
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_PM=y
CONFIG_IA32_EMULATION=y
diff -urPX nopatch linux-2.4.26/fs/binfmt_elf.c linux/fs/binfmt_elf.c
--- linux-2.4.26/fs/binfmt_elf.c Sat Apr 17 02:10:31 2004
+++ linux/fs/binfmt_elf.c Sat Apr 17 02:13:55 2004
@@ -9,6 +9,7 @@
* Copyright 1993, 1994: Eric Youngdale (ericy@cais.com).
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/fs.h>
@@ -43,7 +44,9 @@
#include <linux/elf.h>
static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs);
+#ifdef CONFIG_BINFMT_ELF_AOUT
static int load_elf_library(struct file*);
+#endif
static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int);
extern int dump_fpu (struct pt_regs *, elf_fpregset_t *);
extern void dump_thread(struct pt_regs *, struct user *);
@@ -73,8 +76,14 @@
#define ELF_PAGEOFFSET(_v) ((_v) & (ELF_MIN_ALIGN-1))
#define ELF_PAGEALIGN(_v) (((_v) + ELF_MIN_ALIGN - 1) & ~(ELF_MIN_ALIGN - 1))
-static struct linux_binfmt elf_format = {
- NULL, THIS_MODULE, load_elf_binary, load_elf_library, elf_core_dump, ELF_EXEC_PAGESIZE
+static struct linux_binfmt elf_format = {
+ NULL, THIS_MODULE, load_elf_binary,
+#ifdef CONFIG_BINFMT_ELF_AOUT
+ load_elf_library,
+#else
+ NULL,
+#endif
+ elf_core_dump, ELF_EXEC_PAGESIZE
};
#define BAD_ADDR(x) ((unsigned long)(x) > TASK_SIZE)
@@ -369,6 +378,7 @@
return error;
}
+#ifdef CONFIG_BINFMT_ELF_AOUT
static unsigned long load_aout_interp(struct exec * interp_ex,
struct file * interpreter)
{
@@ -413,6 +423,7 @@
out:
return elf_entry;
}
+#endif
/*
* These are the functions used to load ELF style executables and shared
@@ -420,7 +431,9 @@
*/
#define INTERPRETER_NONE 0
+#ifdef CONFIG_BINFMT_ELF_AOUT
#define INTERPRETER_AOUT 1
+#endif
#define INTERPRETER_ELF 2
@@ -444,7 +457,9 @@
struct elfhdr elf_ex;
struct elfhdr interp_elf_ex;
struct exec interp_ex;
+#ifdef CONFIG_BINFMT_ELF_AOUT
char passed_fileno[6];
+#endif
struct files_struct *files;
/* Get the exec-header */
@@ -556,6 +571,7 @@
/* Some simple consistency checks for the interpreter */
if (elf_interpreter) {
+#ifdef CONFIG_BINFMT_ELF_AOUT
interpreter_type = INTERPRETER_ELF | INTERPRETER_AOUT;
/* Now figure out which format our binary is */
@@ -563,6 +579,9 @@
(N_MAGIC(interp_ex) != ZMAGIC) &&
(N_MAGIC(interp_ex) != QMAGIC))
interpreter_type = INTERPRETER_ELF;
+#else
+ interpreter_type = INTERPRETER_ELF;
+#endif
if (memcmp(interp_elf_ex.e_ident, ELFMAG, SELFMAG) != 0)
interpreter_type &= ~INTERPRETER_ELF;
@@ -571,6 +590,7 @@
if (!interpreter_type)
goto out_free_dentry;
+#ifdef CONFIG_BINFMT_ELF_AOUT
/* Make sure only one type was selected */
if ((interpreter_type & INTERPRETER_ELF) &&
interpreter_type != INTERPRETER_ELF) {
@@ -578,6 +598,7 @@
// printk(KERN_WARNING "ELF: Ambiguous type, using ELF\n");
interpreter_type = INTERPRETER_ELF;
}
+#endif
/* Verify the interpreter has a valid arch */
if ((interpreter_type == INTERPRETER_ELF) &&
!elf_check_arch(&interp_elf_ex))
@@ -590,6 +611,7 @@
/* OK, we are done with that, now set up the arg stuff,
and then start this sucker up */
+#ifdef CONFIG_BINFMT_ELF_AOUT
if (!bprm->sh_bang) {
char * passed_p;
@@ -605,6 +627,7 @@
}
}
}
+#endif
/* Flush all traces of the currently running executable */
retval = flush_old_exec(bprm);
@@ -721,10 +744,12 @@
end_data += load_bias;
if (elf_interpreter) {
+#ifdef CONFIG_BINFMT_ELF_AOUT
if (interpreter_type == INTERPRETER_AOUT)
elf_entry = load_aout_interp(&interp_ex,
interpreter);
else
+#endif
elf_entry = load_elf_interp(&interp_elf_ex,
interpreter,
&interp_load_addr);
@@ -743,7 +768,9 @@
kfree(elf_phdata);
+#ifdef CONFIG_BINFMT_ELF_AOUT
if (interpreter_type != INTERPRETER_AOUT)
+#endif
sys_close(elf_exec_fileno);
set_binfmt(&elf_format);
@@ -757,10 +784,14 @@
&elf_ex,
load_addr, load_bias,
interp_load_addr,
+#ifdef CONFIG_BINFMT_ELF_AOUT
(interpreter_type == INTERPRETER_AOUT ? 0 : 1));
/* N.B. passed_fileno might not be initialized? */
if (interpreter_type == INTERPRETER_AOUT)
current->mm->arg_start += strlen(passed_fileno) + 1;
+#else
+ 1);
+#endif
current->mm->start_brk = current->mm->brk = elf_brk;
current->mm->end_code = end_code;
current->mm->start_code = start_code;
@@ -838,9 +869,9 @@
goto out;
}
+#ifdef CONFIG_BINFMT_ELF_AOUT
/* This is really simpleminded and specialized - we are loading an
a.out library that is given an ELF header. */
-
static int load_elf_library(struct file *file)
{
struct elf_phdr *elf_phdata;
@@ -911,6 +942,7 @@
out:
return error;
}
+#endif
/*
* Note that some platforms still use traditional core dumps and not
diff -urPX nopatch linux-2.4.26/fs/exec.c linux/fs/exec.c
--- linux-2.4.26/fs/exec.c Fri Feb 20 10:07:36 2004
+++ linux/fs/exec.c Sat Apr 17 02:13:55 2004
@@ -109,6 +109,7 @@
*/
asmlinkage long sys_uselib(const char * library)
{
+#if defined(CONFIG_BINFMT_AOUT) || defined(CONFIG_BINFMT_ELF_AOUT)
struct file * file;
struct nameidata nd;
int error;
@@ -155,6 +156,9 @@
exit:
path_release(&nd);
goto out;
+#else
+ return -ENOSYS;
+#endif
}
/*

View File

@@ -1,23 +0,0 @@
#
# Makefile for Broadcom BCM947XX boards
#
# Copyright 2004, Broadcom Corporation
# All Rights Reserved.
#
# THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
# KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
# SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
#
# $Id$
#
O_TARGET := bcm947xx.o
export-objs := nvram_linux.o setup.o
obj-y := prom.o setup.o time.o sbmips.o sbpci.o pcibios.o perfcntr.o gpio.o
obj-y += sflash.o nvram.o nvram_linux.o
vpath %.c $(SRCBASE)/shared $(SRCBASE)/shared/nvram
include $(TOPDIR)/Rules.make

Some files were not shown because too many files have changed in this diff Show More